MongoDB · 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 (ArxValidationException exception) when (exception.Code == ArxErrorCode.InvalidLookup)Create a record that refers to another, scenario 2
Used in:
- Create a record that refers to anotherCreate
- Catch the errors a create meetsCreate
- Catch an injection attemptCreate
- Set up the service from the database's schemaCreate
- Set the service up for productionCreate
- Use fields named outside the name rule, through aliasesCreate
- Log every call through ILoggerCreate
- Create many records in one callCreateMultiple
- Update one recordUpdate
- Choose how the documents are foundUpdate
- Catch an injection attemptUpdate
- Set up the service from the database's schemaUpdate
- Update many records in one callUpdateMultiple
- Choose how the documents are foundDelete
- Catch an injection attemptDelete
- Set up the service from the database's schemaDelete
- Catch an injection attemptRetrieveMultiple
- Set up the service from the database's schemaRetrieveMultiple
- The sample application