HAKOM.Persistence.Sql.Net.Api.Exceptions Namespace
Contains exception types that are raised by the database-agnostic SQL persistence layer when connection, query, or column-reading operations fail.
Remarks
Section titled “Remarks”All exceptions in this namespace inherit from
HakomException and carry a unique
HK##### error code. Each exception also specifies an
System.Net.HttpStatusCode so that HTTP middleware can map it to
the appropriate response status.
The exceptions defined here are:
- AttemptingToConnectToSqlDatabaseFailedException — Thrown when no connection could be established to the SQL database (HK12028).
- ColumnIsNullException — Thrown when reading a non-nullable column that contains a NULL value (HK12025).
- ConnectionDidNotReturnTheProperCommandTypeException — Thrown when the connection’s
CreateCommanddoes not return the expected command type (HK12018). - InvalidColumnTypeException — Thrown when a column’s CLR type does not match the type expected by the
Read*method (HK12010). - InvalidSqlFloatValueException — Thrown when an invalid floating-point value such as
NaNorInfinityis used in a SQLFLOATcolumn (HK12045). - NoParserSuppliedException — Thrown when neither a synchronous nor asynchronous parser is supplied to a
Selectmethod (HK12019). - ParserThrewAnErrorException — Wraps an exception thrown by the user-supplied parser during row processing (HK12032).
- ProviderFactoryDidNotReturnTheProperConnectionTypeException — Thrown when the System.Data.Common.DbProviderFactory returns a connection that cannot be cast to the expected type (HK12016).
- SelectQueryDidNotReturnAnyRowsException — Thrown when a
SelectFirstcall produces an empty result set (HK12029). - UnexpectedErrorDuringQueryException — Wraps an unexpected System.Data.Common.DbException that occurred while executing a query (HK12030).
| Classes | |
|---|---|
| AttemptingToConnectToSqlDatabaseFailedException | The exception that is thrown when no connection to the SQL data base has been established. |
| ColumnIsNullException | Thrown when attempting to read null values with not-nullable return types. |
| ConnectionDidNotReturnTheProperCommandTypeException | TryCreateCommand(TConnection) is not able to create a command object. |
| InvalidColumnTypeException | Thrown if the column type does not match the expected type. |
| InvalidSqlFloatValueException | Exception thrown when an attempt is made to insert an invalid floating-point value, such as NaN or Infinity, into a SQL Server FLOAT column. |
| NoParserSuppliedException | Neither sync nor async parser function was supplied for a select method of: SqlStorageProvider<TConnection,TCommand,TNativeParameter,TReader,TParameter,TParameterFactory>. |
| ParserThrewAnErrorException | This exception is thrown when a value from an SQL database (with Select or TrySelect) could not be parsed to the desired object. |
| ProviderFactoryDidNotReturnTheProperConnectionTypeException | Thrown if the System.Data.Common.DbProviderFactory returns a connection type which does not match TConnection of SqlStorageProvider<TConnection,TCommand,TNativeParameter,TReader,TParameter,TParameterFactory>. |
| SelectQueryDidNotReturnAnyRowsException | Thrown when a call to SelectFirst<TResult>(string, Func<TReader,Task<TResult>>, CancellationToken) or similar returned no results. |
| UnexpectedErrorDuringQueryException | Thrown when an unexpected error occurred during an SQL query. |
Was this page helpful?Thanks for your feedback!