Handling errors
Handling errors
In Windows Store and Windows Phone applications, every error is returned as a COMException. You can use DBError methods to get the error code and text from the HResult.
For C++ development, all errors are derived from the std::exception class.
For .NET Framework development, all errors are derived from the .NET Framework Exception class.
KitaroDB error codes
BADKEY | Illegal key specified |
ILLKYA | Illegal alpha key of reference |
INVNUL | Invalid null value |
OVLKEY | Invalid overlay of numeric key |
SPNEOR | Key spans end of reference |
One of the following has occurred:
|
|
BADLCK | Lock failure |
An attempt to acquire a file or record lock failed due to an unexpected system error. | |
CREAT | Cannot create file |
OPNDAT | Cannot open data file |
OPNERR | Cannot open index file |
An error occurred during a DB.Open[Async] operation. | |
DCMPR | Data Compression/uncompression error |
DINCON | Data incongruity, key to deleted rec |
DFREE | Data freelist error |
IINCON | Index incongruity error |
QINCON | Qualifier incongruity error |
SEGERR | Mismatched segments |
An internal error occurred, and it may be due to a corrupted file. Use the kdbutl utility to check the file. See kdbutl. | |
ENDFIL | EOF encountered |
You have attempted to access information beyond the logical or physical end of a file (detected by DBCursor.MoveNext[Async], DB.Select[Async], or DBCursor.MoveFirst[Async]). | |
FILFUL | No room to write to file |
All space allocated for a file has been filled. The file cannot be extended with DB.Insert[Async]. | |
FILOPT | Bad I/O operations in I/O statement |
You have attempted an operation that is not allowed for the mode in which the file was opened (for example, attempting to update a file opened in read-only mode). | |
FILSPC | Bad file specification |
The file specification contains a syntactical error or the file is empty. | |
FILUSE | File in use by another user |
One of the following has occurred:
|
|
FNF | File not found |
A file with the specified filename cannot be found (e.g., a filename specified for DB.Open[Async], DB.Purge[Async], or DB.Rename[Async]). | |
INSMEM | Insufficient memory for attempted op |
There was not enough memory for the attempted operation. | |
IOERR | I/O error |
NOFLSH | Flush error |
RDERR | I/O error: Read failure |
WTERR | I/O error: Write failure |
Data transfer failed during an I/O operation. | |
IRCSIZ | Invalid record size |
An invalid record size has been specified. This error generally occurs on a DB.Insert[Async] or DB.Update[Async] operation and may occur if the buffer you are passing is larger than the maximum record size. | |
KYNSAM | Key not same |
The specified key value doesn’t match an existing record in the file. This error is related to I/O operations involving ISAM files and can occur for any of the following reasons:
|
|
NODUPS | No duplicates allowed |
A DB.Insert[Async] or DB.Update[Async] method call attempted to store a duplicate key value for a key that doesn’t accept duplicates. | |
NOCURR | No current record established |
You have not established a current record, and one is required for the operation you are attempting. This error can occur when a needed DB.Select[Async] or DBCursor.Move*[Async] operation does not precede a DB.Update[Async], DB.Delete[Async], or DB.Insert[Async] operation. | |
NOPRIV | No privilege to this file or directory |
You have attempted to access a file that is protected from update. | |
NOTAVL | Device not available |
The device you have attempted to access is not available. | |
RECLOC | Record is locked |
You have attempted to access a record or group of records that is being used by another user or thread. | |
RNF | Record not found (no record read/found) |
The specified record does not exist. | |
SPRFIL | Existing file, cannot overwrite |
You have attempted to overwrite a file (with DB.Create[Async] or DB.Rename[Async]) that is protected against deletion. | |
UNDKEY | Undefined keys, cannot create |
You have defined more keys than are defined in the key definition in the array. |