CryptoSys API  6.22.1
Static Public Member Functions | List of all members
crsysapi::Err Class Reference

Details of errors returned by the core library. More...

Static Public Member Functions

static int ErrorCode ()
 Retrieve error code of the error that occurred when calling the last function (if available). More...
 
static std::string ErrorLookup (int errCode)
 Look up description for error code. More...
 
static std::string FormatErrorMessage (int errCode=0)
 Return an error message string for the last error. More...
 

Detailed Description

Details of errors returned by the core library.

Member Function Documentation

◆ ErrorCode()

static int crsysapi::Err::ErrorCode ( )
static

Retrieve error code of the error that occurred when calling the last function (if available).

Returns
Error code of the error that occurred when calling the last function, or zero if no error occurred.
Remarks
The value returned is always a non-negative integer greater than or equal to zero. Not all functions set this value.

◆ ErrorLookup()

static std::string crsysapi::Err::ErrorLookup ( int  errCode)
static

Look up description for error code.

Parameters
errCodeCode number (may be positive or negative)
Returns
Corresponding error message.

◆ FormatErrorMessage()

static std::string crsysapi::Err::FormatErrorMessage ( int  errCode = 0)
static

Return an error message string for the last error.

Parameters
errCodeError code returned by last call.
Returns
Error message as a string "Error ({errCode}): {errorlookup}[: {lasterror}]"
Remarks
Example:
crsysapi::Hash::HexFromBits: Too many bits for data byte array: Error (11): Parameter out of range (RANGE_ERROR)
static std::string HexFromBits(const bvec_t &data, int dataBitLen, Alg alg=Alg::Sha1)
Compute hash value in hex format from bit-oriented input.
Copyright © 2001-24 D.I. Management Services Pty Limited ABN 78 083 210 584 Australia. All rights reserved. <www.di-mgt.com.au> <www.cryptosys.net>. Generated on Sat Jan 6 2024 18:00:07 by Doxygen 1.9.1.