![]() |
API参考
|
error module 更多...

类 | |
| struct | BSL_ERR_Desc |
| Add error description. 更多... | |
宏定义 | |
| #define | BSL_ERR_NEW_MODULE 0x80 |
| Start value of the customized level-1 error module. | |
类型定义 | |
| typedef void(* | BSL_ERR_OutputFunc) (uint64_t threadId, const char *file, uint32_t lineNo, int32_t errCode, bool mark) |
| Err output callback function type. | |
函数 | |
| int32_t | BSL_ERR_Init (void) |
| Initialize Error code module. | |
| void | BSL_ERR_DeInit (void) |
| Error code module deinitialization. | |
| void | BSL_ERR_RemoveErrorStack (bool isRemoveAll) |
| Delete the error stack | |
| int32_t | BSL_ERR_GetLastError (void) |
| Obtains the error code of the last push in the error stack. | |
| int32_t | BSL_ERR_PeekLastError (void) |
| Obtains the error code of the last push in the error stack. | |
| int32_t | BSL_ERR_PeekError (void) |
| Obtain the earliest push error code in the error stack. | |
| int32_t | BSL_ERR_GetLastErrorFileLine (const char **file, uint32_t *lineNo) |
| Obtains the error code, file name, and line number of the last push message in the error stack. | |
| int32_t | BSL_ERR_PeekLastErrorFileLine (const char **file, uint32_t *lineNo) |
| Obtain the error code, file name, and line number of the last push message in the error stack. | |
| int32_t | BSL_ERR_GetError (void) |
| Obtain the earliest push error code in the error stack. | |
| int32_t | BSL_ERR_GetErrorFileLine (const char **file, uint32_t *lineNo) |
| Obtain the error code, file name, and line number of the earliest push message in the error stack. | |
| int32_t | BSL_ERR_PeekErrorFileLine (const char **file, uint32_t *lineNo) |
| Obtain the error code, file name, and line number of the earliest push message in the error stack. | |
| void | BSL_ERR_ClearError (void) |
| Clear the error stack. | |
| int32_t | BSL_ERR_AddErrStringBatch (const BSL_ERR_Desc *descList, uint32_t num) |
| Add an error description string to an error code. | |
| void | BSL_ERR_RemoveErrStringBatch (void) |
| Delete the error description | |
| const char * | BSL_ERR_GetString (int32_t error) |
| Obtain the error description string based on the error code. | |
| int32_t | BSL_ERR_GetErrAll (const char **file, uint32_t *lineNo, const char **desc) |
| Obtain the error description string based on the error code. | |
| int32_t | BSL_ERR_SetMark (void) |
| Set the pop-up flag at the level of the current error stack. | |
| int32_t | BSL_ERR_PopToMark (void) |
| Pop to the marked error stack level and clear the mark | |
| int32_t | BSL_ERR_ClearLastMark (void) |
| Clear the latest flag in the error stack. | |
| void | BSL_ERR_RegErrStackLog (const BSL_ERR_OutputFunc func) |
| Register a err output callback function with dual protection | |
| void | BSL_ERR_OutputErrorStack (void) |
| Print all error information in the current error stack. | |
error module
| #define BSL_ERR_NEW_MODULE 0x80 |
Start value of the customized level-1 error module.
Start value of the customized level-1 error module. The value 0x80 is 128.
| typedef void(* BSL_ERR_OutputFunc) (uint64_t threadId, const char *file, uint32_t lineNo, int32_t errCode, bool mark) |
Err output callback function type.
Callback function type for error output.
| threadId | [IN] Thread ID. |
| file | [IN] File name. |
| lineNo | [IN] Line number. |
| errCode | [IN] Error code. |
| mark | [IN] Mark flag. |
| int32_t BSL_ERR_AddErrStringBatch | ( | const BSL_ERR_Desc * | descList, |
| uint32_t | num ) |
Add an error description string to an error code.
The error description string is added to the error code. The error description can be extended to the user side.
| descList | [IN] BSL_ERR_Desc array |
| num | [IN] Length of descList |
| #BSL_SUCCESS. | |
| For | details, see bsl_errno.h |
| void BSL_ERR_ClearError | ( | void | ) |
Clear the error stack.
If an error is detected after the HiTLS API is called, if the error information is ignored, call this API to clear the error information before calling the HiTLS API again.
| int32_t BSL_ERR_ClearLastMark | ( | void | ) |
Clear the latest flag in the error stack.
Clear the latest flag in the error stack.
| BSL_ERR_ERR_ACQUIRE_WRITE_LOCK_FAIL,failed | to obtain the write lock. |
| BSL_ERR_ERR_NO_STACK,no | error stack. |
| BSL_SUCCESS,cleared | successfully. |
| void BSL_ERR_DeInit | ( | void | ) |
Error code module deinitialization.
Called by the user when the process exits.
| int32_t BSL_ERR_GetErrAll | ( | const char ** | file, |
| uint32_t * | lineNo, | ||
| const char ** | desc ) |
Obtain the error description string based on the error code.
Obtain the corresponding error description string based on the error code.
| error | [IN] Error code |
| Error | description |
| int32_t BSL_ERR_GetError | ( | void | ) |
Obtain the earliest push error code in the error stack.
This API is called when an error occurs on a HiTLS API to obtain the error code. The API can be called all the time. The error code returned each time forms the error stack of the interface until BSL_SUCCESS is returned.
| Error | code. The most significant 16 bits indicate the ID of the module where the error occurs, and the least significant 16 bits indicate the cause number. |
| int32_t BSL_ERR_GetErrorFileLine | ( | const char ** | file, |
| uint32_t * | lineNo ) |
Obtain the error code, file name, and line number of the earliest push message in the error stack.
The user calls this API after an error occurs on a HiTLS API to obtain an error code, file name, and line number. The obtained information will be deleted from the error stack. This API can be called continuously. The returned error code forms the error stack of the API until BSL_SUCCESS is returned.
| file | [OUT] Obtains the name of the file where the error occurs, excluding the directory path. |
| lineNo | [OUT] Obtain the line number of the file where the error occurs. |
| Error | code. The most significant 16 bits indicate the ID of the module where the error occurs, and the least significant 16 bits indicate the cause number. |
| int32_t BSL_ERR_GetLastError | ( | void | ) |
Obtains the error code of the last push in the error stack.
This API is called when an error occurs on a HiTLS interface to obtain the error code. The interface can be called continuously. The error code returned each time forms the error stack of the interface until BSL_SUCCESS is returned.
| Error | code. The most significant 16 bits indicate the ID of the module where the error occurs, and the least significant 16 bits indicate the cause number. |
| int32_t BSL_ERR_GetLastErrorFileLine | ( | const char ** | file, |
| uint32_t * | lineNo ) |
Obtains the error code, file name, and line number of the last push message in the error stack.
When an error occurs in a HiTLS interface, the user obtains an error code, file name, and line number. The obtained information is deleted from the error stack. The interface can be called continuously. The error code returned each time forms the error stack of the interface until BSL_SUCCESS is returned.
| file | [OUT] Obtains the name of the file where the error occurs, excluding the directory path |
| lineNo | [OUT] Obtain the line number of the file where the error occurs |
| Error | code. The most significant 16 bits indicate the ID of the module where the error occurs, and the least significant 16 bits indicate the cause number. |
| const char * BSL_ERR_GetString | ( | int32_t | error | ) |
Obtain the error description string based on the error code.
Obtain the corresponding error description string based on the error code.
| error | [IN] Error code |
| Error | description |
| int32_t BSL_ERR_Init | ( | void | ) |
Initialize Error code module.
The user must call this interface to initialize.
| BSL_SUCCESS,error | code module is successfully initialized. |
| BSL_MALLOC_FAIL,memory | space is insufficient and thread lock space cannot be applied for. |
| BSL_SAL_ERR_UNKNOWN,thread | lock initialization failed. |
| void BSL_ERR_OutputErrorStack | ( | void | ) |
Print all error information in the current error stack.
Print all error information in the current error stack.
| int32_t BSL_ERR_PeekError | ( | void | ) |
Obtain the earliest push error code in the error stack.
This API is called when an error occurs on a HiTLS API to obtain the error code. The API can be called all the time. The error code returned each time forms the error stack of the interface until BSL_SUCCESS is returned.
| Error | code. The most significant 16 bits indicate the ID of the module where the error occurs, and the least significant 16 bits indicate the cause number. |
| int32_t BSL_ERR_PeekErrorFileLine | ( | const char ** | file, |
| uint32_t * | lineNo ) |
Obtain the error code, file name, and line number of the earliest push message in the error stack.
When an error occurs on a HiTLS interface, the user obtains an error code, file name, and line number. The obtained information is not deleted from the error stack.
| file | [OUT] Obtains the name of the file where the error occurs, excluding the directory path. |
| lineNo | [OUT] Obtain the line number of the file where the error occurs. |
| Error | code. The most significant 16 bits indicate the ID of the module where the error occurs, and the least significant 16 bits indicate the cause number. |
| int32_t BSL_ERR_PeekLastError | ( | void | ) |
Obtains the error code of the last push in the error stack.
This API is called when an error occurs on a HiTLS interface to obtain the error code. The interface can be called continuously. The error code returned each time forms the error stack of the interface until BSL_SUCCESS is returned.
| Error | code. The most significant 16 bits indicate the ID of the module where the error occurs, and the least significant 16 bits indicate the cause number. |
| int32_t BSL_ERR_PeekLastErrorFileLine | ( | const char ** | file, |
| uint32_t * | lineNo ) |
Obtain the error code, file name, and line number of the last push message in the error stack.
When an error occurs on a HiTLS interface, the user obtains an error code, file name, and line number. The obtained information is not deleted from the error stack.
| file | [OUT] Obtains the name of the file where the error occurs, excluding the directory path. |
| lineNo | [OUT] Obtain the line number of the file where the error occurs. |
| Error | code. The most significant 16 bits indicate the ID of the module where the error occurs, and the least significant 16 bits indicate the cause number. |
| int32_t BSL_ERR_PopToMark | ( | void | ) |
Pop to the marked error stack level and clear the mark
Pop up to the error stack level of the mark and clear the mark
| BSL_ERR_ERR_ACQUIRE_WRITE_LOCK_FAIL,failed | to obtain the write lock. |
| BSL_ERR_ERR_NO_STACK,no | error stack. |
| BSL_ERR_ERR_NO_ERROR,no | error. |
| #BSL_ERR_ERR_NO_Mark,no | mark. |
| BSL_SUCCESS,pop-up | succeeded. |
| void BSL_ERR_RegErrStackLog | ( | const BSL_ERR_OutputFunc | func | ) |
Register a err output callback function with dual protection
| func | Callback function to register |
| void BSL_ERR_RemoveErrorStack | ( | bool | isRemoveAll | ) |
Delete the error stack
Delete the error stack, which is called when a process or thread exits.
| isRemoveAll | [IN] Indicates whether to delete all error stacks. The value is true when a process exits and false when a thread exits. |
| void BSL_ERR_RemoveErrStringBatch | ( | void | ) |
Delete the error description
The error description is deleted. If BSL_ERR_AddErrStringBatch is called, you need to use this API to release the memory.
| int32_t BSL_ERR_SetMark | ( | void | ) |
Set the pop-up flag at the level of the current error stack.
Set the pop-up flag.
| BSL_ERR_ERR_ACQUIRE_WRITE_LOCK_FAIL,failed | to obtain the write lock. |
| BSL_ERR_ERR_NO_STACK,no | error stack. |
| BSL_ERR_ERR_NO_ERROR,no | error. |
| BSL_SUCCESS,the | flag is set successfully. |