MkExceptionC - The default-exception of the Programming-Language-Micro-Kernel (PLMK) … More...
Functions | |
bool | libmkkernel::MkExceptionCheck (MK_EXP exception) |
Checks if Exception is of type MkExceptionC and returns true or false … | |
void | libmkkernel::MkExceptionRaise (MK_MNG const expobj, MK_STRN const callfunc, MK_I32 const callline) |
convert an MkErrorC into a Target-Programming-Language (TPL) exception … | |
MK_ERR | libmkkernel::MkExceptionCatch (MK_MNG const expobj, MK_EXP const exception, MK_STRN const callfunc) |
convert an Target-Programming-Language (TPL) exception into an MkErrorC … | |
MkExceptionC - The default-exception of the Programming-Language-Micro-Kernel (PLMK) …
The Programming-Language-Micro-Kernel (PLMK) provide with MkErrorC a complete error-handling with focus to support the "C"
Programming-Language. The support include catch, raise, signal and attributes. In addition every Target-Programming-Language (TPL) add their own error-handling and the purpose of MkExceptionC is to integrate the MkErrorC into the Target-Programming-Language (TPL).
The default-exception MkExceptionC is used to connect the MkErrorC with the Target-Programming-Language (TPL) error-object.
The implementation of an exception depends heavily on the Target-Programming-Language (TPL), starting with no exception at all, for example. C
, an exception as a class object, or as an exception as a global attribute.
MK_ERR libmkkernel::MkExceptionCatch | ( | MK_MNG const | expobj, |
MK_EXP const | exception, | ||
MK_STRN const | callfunc ) |
convert an Target-Programming-Language (TPL) exception into an MkErrorC …
[in] | expobj | The LibMsgqueObject used to personalize the exception/error (will be validated first) |
[in] | exception | the exception object from C++, if MK_NULL the global exception object is used |
[in] | callfunc | a user-defined postfix to identify the calling function or the environment (default=name-of-function ) |
bool libmkkernel::MkExceptionCheck | ( | MK_EXP | exception | ) |
Checks if Exception is of type MkExceptionC and returns true
or false
…
Example: test case to check KILL and RECOVER feature, check on MkExceptionC
MK_I32 PID, RET=0; auto VAL = ReadBUF(); Client cl; cl.LinkCreate(ConfigGetStartAs()); cl.Send("W","GPID@I", &PID); SysKill(PID,9); for (int i = 0; i < 3; i++) { try { cl.Send("W","ECOI:U@I", VAL, &RET); } catch (const MkExceptionC &ex) { auto err = cl.ErrorCatch(ex); if (err->IsSOCKET()) { err->Reset(); cl.LinkConnect(); continue; } else { err->Raise(); } } break; } SendSTART(); SendI32(RET);
true
or false
[in] | exception | the exception object from C++, if MK_NULL the global exception object is used |
void libmkkernel::MkExceptionRaise | ( | MK_MNG const | expobj, |
MK_STRN const | callfunc, | ||
MK_I32 const | callline ) |
convert an MkErrorC into a Target-Programming-Language (TPL) exception …
[in] | expobj | The LibMsgqueObject used to personalize the exception/error (will be validated first) |
[in] | callfunc | a user-defined postfix to identify the calling function or the environment (default=name-of-function ) |
[in] | callline | the number of the line the call take place (e.g. LINE) |