This ticket involves updating the api_err.py script to include the generation of sub-level error codes. The script does multiple things to accommodate for our existing WiredTiger codes. The error codes are generated inside wiredtiger.h and starts at (-31800). Follow:
/* * DO NOT EDIT: automatically built by dist/api_err.py. * Error return section: BEGIN */ /*! * Conflict between concurrent operations. * This error is generated when an operation cannot be completed due to a * conflict with concurrent operations. The operation may be retried; if a * transaction is in progress, it should be rolled back and the operation * retried in a new transaction. */ #define WT_ROLLBACK (-31800)
The new sub-level error code will start on a different subset of integer codes (-32000). Following the script also automatically generates the strerr for the error codes. The sub-level error code should also contain this functionality. Safety measure should also be added to make sure that errors are not used interchangeably.
Defintion of Done
The ticket is completed when a basic default sub-level error code is generated through api_err.py called WT_NONE. With a description under strerr. A unit test should be created that tests that the returned sub-level error has a string when calling strerr.