Maps SDK for C++ 1.0.0
Loading...
Searching...
No Matches
gem::TypedApiError< TError > Class Template Reference

Api error handler. More...

Static Public Member Functions

template<typename TErrorConvertible>
static TError setError (TErrorConvertible err, bool throwErr)
 Sets the Api error to given value.
static TError getError ()
 Gets the last Api error.
static bool isExceptionEnabled ()
 Checks if exception mechanism is enabled.
static void blockExc ()
 Blocks the exceptions mechanism.
static void unblockExc ()
 Unblocks the exceptions mechanism.
static std::error_code getStdError ()

Friends

class ExceptionEnabler

Detailed Description

template<typename TError>
class gem::TypedApiError< TError >

Api error handler.

Member Function Documentation

◆ getError()

template<typename TError>
TError gem::TypedApiError< TError >::getError ( )
inlinestatic

Gets the last Api error.

Returns
The last error

◆ getStdError()

template<typename TError>
std::error_code gem::TypedApiError< TError >::getStdError ( )
inlinestatic
Returns
Convert to a std error
The std error

◆ isExceptionEnabled()

template<typename TError>
bool gem::TypedApiError< TError >::isExceptionEnabled ( )
inlinestatic

Checks if exception mechanism is enabled.

Returns
True if enabled, false otherwise

◆ setError()

template<typename TError>
template<typename TErrorConvertible>
TError gem::TypedApiError< TError >::setError ( TErrorConvertible err,
bool throwErr )
inlinestatic

Sets the Api error to given value.

If exception mechanism is enabled will throw a corresponding exception

Parameters
errThe error value
throwErrIf true, will throw an exception
Returns
The error value