PostgreSQL · Types · Errors
ArxErrorCode
Definition
- Namespace
ARX.SDK- Package
ARX.SDK
public enum ArxErrorCodeStable ARX error codes, identical in every provider and language. The thousands digit is the category. Numbers are never reused or renumbered; names are the cross-language identifiers.
Values
InvalidArgument= 1001Invalid input not covered by a more specific code.
MissingEntityName= 1002The entity name is null or blank.
InvalidIdentifier= 1003An entity or attribute name fails the identifier rules.
DuplicateAttribute= 1004The same attribute appears more than once (names are case-insensitive).
InvalidLookup= 1005A lookup (
ArxEntityReference) has no usable Id.InvalidSelectionSet= 1006A selection set value has no option set name.
UnsupportedValueType= 1007An attribute value has a type the provider can't write.
InvalidConnection= 1008The connection or transaction is of the wrong driver type, or the service has no connection string.
TransactionMismatch= 1009The transaction belongs to a different connection.
TransactionCompleted= 1010The transaction has already been committed, rolled back or disposed.
SelectionSetValueNotAllowed= 1011A selection set value isn't allowed by its set in the catalog: not one of its options, of the wrong kind, a retired option, several values for a single-choice set, a duplicate, or a value the set's storage can't hold.
UnknownSelectionSet= 1012A selection set value names a set that isn't in the catalog, or no catalog was supplied.
InvalidDateTimeValue= 1013A date or time value that would be stored as something else than the caller meant: default(DateTime), default(DateTimeOffset) or default(DateOnly) (no real date: a database would store a sentinel or refuse it), or an array mixing UTC and Unspecified DateTime values.
BatchScopeBusy= 1014A batch scope was called while another call on it was still running. A scope holds one connection, which runs one command at a time: await each call before the next.
TransactionAborted= 1015A call or a commit on a transaction that an earlier failed call has aborted. The database has already discarded the transaction's work; it can only be rolled back.
IdNotDeclared= 1016The entity's table isn't declared in the service's schema catalog, and the entity doesn't declare its own id column. A service with a catalog uses only what is declared: ARX doesn't guess an id column. A service created without a catalog reads the table's primary key instead (where the provider can), and raises
TableNotResolvablewhen it can't.SuspectedInjection= 1017A name (entity, attribute, match column or type) contains SQL syntax: a quote, a statement separator, a comment marker, a bracket, an operator or an SQL keyword after a space. That is the shape of an SQL injection attempt, not of a typo, so it gets its own code to alert on. Refused before the database: nothing was sent. Values are never checked for this: they are always parameters, and any text is stored as typed.
NotPreloaded= 1018The service is
Strictand the call names a table or column that wasn't preloaded: refused before the database. Preload it, or turn Strict off.TableNotResolvable= 1019A service without a schema catalog resolves each table from the database, and this table has no id the call can use: no primary key, a primary key of several columns, or one of a type ARX can't use as an id. Refused before anything is sent, only for a call that needs the id (Create, Retrieve, Update or Delete by id). Declare the table in a schema catalog (
ArxIdColumn.NoIdColumn), or match by a key or columns.RecordNotFound= 2002The record addressed by key doesn't exist.
MultipleRecordsMatched= 2003An update or delete with
RequireSingleRowfound more than one row for an entity. Nothing was changed.RecordChanged= 2004The record was changed since it was read: an Update or Delete carried a version (optimistic concurrency) that isn't the record's any more. Nothing was changed: read it again, and apply the change to what is there now.
UniqueViolation= 3001A unique constraint or key was violated.
ForeignKeyViolation= 3002A referenced record is missing, or a record is still referenced.
NotNullViolation= 3003A required attribute has no value.
CheckViolation= 3004A check constraint or validation rule failed.
RaisedByDatabase= 3005A routine the database runs (a procedure or function) refused the call on purpose (PostgreSQL
RAISE EXCEPTION, SQL ServerTHROW, MySQLSIGNAL). On PostgreSQL:RAISE EXCEPTION(SQLSTATE P0001), anASSERTor a state of the routine's own (USING ERRCODE = 'AX001'). The message is the routine's;SqlState,DetailandHintare its own.ValueOutOfRange= 4001A number is outside the column's range.
ValueTooLong= 4002Text or binary data is longer than the column allows.
InvalidValueFormat= 4003A value can't be parsed for its column (for example invalid JSON, dates or encoding).
DataTypeMismatch= 4004A value's type doesn't fit the column.
UndefinedEntity= 5001The table or collection doesn't exist.
UndefinedAttribute= 5002The column doesn't exist or can't be written.
SchemaMismatch= 5003A declaration in the schema catalog doesn't match the table: the database returned an id of another type, or
ValidateSchemaAsyncfound a difference. The exception says whether rows were stored.PermissionDenied= 6001The database user lacks the required permission.
Deadlock= 7001The operation was chosen as a deadlock victim. Safe to retry.
SerializationFailure= 7002The operation conflicted with a concurrent transaction. Safe to retry.
Timeout= 7003The command or a lock wait timed out. Safe to retry.
Throttled= 7004The server is rate-limiting or out of connections. Safe to retry later.
ConnectionFailure= 7005The database couldn't be reached, or the connection dropped. Safe to retry.
NotSupported= 8001The provider doesn't support the requested operation or feature.
ProviderError= 9001A native error the provider doesn't map; see NativeCode and SqlState.
Usage
A line from a verified sample; the full, runnable code is on its page.
catch (ArxDatabaseException error) when (error.Code == ArxErrorCode.ForeignKeyViolation)Create a record that points at another one, scenario 4
Used in:
- Create a record that points at another oneCreate
- Catch an error by its codeCreate
- Where to declare: on the entity, or a schema for one call, never bothCreate
- Create without a catalogCreate
- Every supported .NET type, and what PostgreSQL storesCreate
- Instants, local times, dates and times of dayCreate
- Picklist values checked against the application's catalogCreate
- Turn ARX error codes into messages for the userCreate
- Values and names that come from users or filesCreate
- Natural ids, uuid ids and a table with a compound keyCreate
- Catch an SQL injection attempt on createCreate
- Several calls in one ARX transaction: commit or roll backCreate
- Load ids and keys from JSON and validate them at startupCreate
- Write to two databases, each with its own serviceCreate
- Preload the schema at service setup: keys only, data types, StrictCreate
- Set the service up for productionCreate
- Use columns named outside the name rule, through aliasesCreate
- Log every call through ILoggerCreate
- Create many records in one call and get their idsCreateMultiple
- Save an account's contacts in one callCreateMultiple
- Import a 20,000-item product feed in one callCreateMultiple
- Import 5,000 contacts in batches, in one transactionCreateMultiple
- Catch a record that doesn't existUpdate
- Find rows by id, by key or by columnsUpdate
- Turn update errors into messagesUpdate
- Change prices found by a compound keyUpdate
- Catch an SQL injection attempt on updateUpdate
- Updates in one ARX transaction: commit, roll back, abortUpdate
- Update on a preloaded schema: keys only, data types, StrictUpdate
- Update many records in one callUpdateMultiple
- Reprice 20,000 products from a feedUpdateMultiple
- Stock counts in batches: one transaction, a failed batch skippedUpdateMultiple
- Delete by key, by compound key, by columnsDelete
- Delete without a catalogDelete
- A referenced record: ARX3002, then delete in orderDelete
- Catch an SQL injection attempt on deleteDelete
- Delete on a preloaded schema: keys only, StrictDelete
- Find a record by id, key or columnsRetrieve
- Turn read errors into messagesRetrieveMultiple
- Catch an SQL injection attempt on a searchRetrieveMultiple
- Paging in depth: the total is opt-in, ask once, load more, Top, seek pagingRetrieveMultiple
- Read other row sources: a view in a schema, a materialized view, a partitioned tableRetrieveMultiple
- Read functions in depth: table rows, OUT values, one value, records, writes, proceduresRetrieveMultiple
- Views in depth: computed criteria, links both ways, declared ids and lookups, column boundariesRetrieveMultiple
- Retrieve on a preloaded schema: lookups found, enums typed, Strict, saved JSONRetrieveMultiple
- Business errors raised by a procedureExecute
- A nightly job that commits in batchesExecute
- Catch an SQL injection attempt on ExecuteExecute
- Execute in an ARX transactionExecute
- Execute in a batch scope: a refused call undone aloneExecute
- Execute on a preloaded, Strict schema: routines aren't covered, tables areExecute
- The sample application