SQL Server · Types · Errors

ArxErrorCode

Definition

Namespace
ARX.SDK
Package
ARX.SDK
C#
public enum ArxErrorCode

Stable 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= 1001

Invalid input not covered by a more specific code.

MissingEntityName= 1002

The entity name is null or blank.

InvalidIdentifier= 1003

An entity or attribute name fails the identifier rules.

DuplicateAttribute= 1004

The same attribute appears more than once (names are case-insensitive).

InvalidLookup= 1005

A lookup (ArxEntityReference) has no usable Id.

InvalidSelectionSet= 1006

A selection set value has no option set name.

UnsupportedValueType= 1007

An attribute value has a type the provider can't write.

InvalidConnection= 1008

The connection or transaction is of the wrong driver type, or the service has no connection string.

TransactionMismatch= 1009

The transaction belongs to a different connection.

TransactionCompleted= 1010

The transaction has already been committed, rolled back or disposed.

SelectionSetValueNotAllowed= 1011

A 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= 1012

A selection set value names a set that isn't in the catalog, or no catalog was supplied.

InvalidDateTimeValue= 1013

A 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= 1014

A 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= 1015

A 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= 1016

The 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 TableNotResolvable when it can't.

SuspectedInjection= 1017

A 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= 1018

The service is Strict and the call names a table or column that wasn't preloaded: refused before the database. Preload it, or turn Strict off.

TableNotResolvable= 1019

A 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= 2002

The record addressed by key doesn't exist.

MultipleRecordsMatched= 2003

An update or delete with RequireSingleRow found more than one row for an entity. Nothing was changed.

RecordChanged= 2004

The 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= 3001

A unique constraint or key was violated.

ForeignKeyViolation= 3002

A referenced record is missing, or a record is still referenced.

NotNullViolation= 3003

A required attribute has no value.

CheckViolation= 3004

A check constraint or validation rule failed.

RaisedByDatabase= 3005

A routine the database runs (a procedure or function) refused the call on purpose (PostgreSQL RAISE EXCEPTION, SQL Server THROW, MySQL SIGNAL). On PostgreSQL: RAISE EXCEPTION (SQLSTATE P0001), an ASSERT or a state of the routine's own (USING ERRCODE = 'AX001'). The message is the routine's; SqlState, Detail and Hint are its own.

ValueOutOfRange= 4001

A number is outside the column's range.

ValueTooLong= 4002

Text or binary data is longer than the column allows.

InvalidValueFormat= 4003

A value can't be parsed for its column (for example invalid JSON, dates or encoding).

DataTypeMismatch= 4004

A value's type doesn't fit the column.

UndefinedEntity= 5001

The table or collection doesn't exist.

UndefinedAttribute= 5002

The column doesn't exist or can't be written.

SchemaMismatch= 5003

A declaration in the schema catalog doesn't match the table: the database returned an id of another type, or ValidateSchemaAsync found a difference. The exception says whether rows were stored.

PermissionDenied= 6001

The database user lacks the required permission.

Deadlock= 7001

The operation was chosen as a deadlock victim. Safe to retry.

SerializationFailure= 7002

The operation conflicted with a concurrent transaction. Safe to retry.

Timeout= 7003

The command or a lock wait timed out. Safe to retry.

Throttled= 7004

The server is rate-limiting or out of connections. Safe to retry later.

ConnectionFailure= 7005

The database couldn't be reached, or the connection dropped. Safe to retry.

NotSupported= 8001

The provider doesn't support the requested operation or feature.

ProviderError= 9001

A native error the provider doesn't map; see NativeCode and SqlState.

Usage

C#

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: