theKernel 10.0
|
MkErrorC - the class known as err or error is used to create and manage an error message … More...
Public Member Functions | |
new MkErrorC | Next () |
C#: → C-API get next instance from linked-list of MkErrorS type | |
new MkErrorC | Prev () |
C#: → C-API get previous instance from linked-list of MkErrorS type | |
MkErrorE | GetCode () |
C#: → C-API get the value of MkErrorS::code … | |
int | GetNum () |
C#: → C-API get the MkErrorS::num. The number can be used as exit-code … | |
long | GetSize () |
C#: → C-API get the error-message-size from the exception-object … | |
string | GetText () |
C#: → C-API get the MkErrorS::text … | |
MkErrorC | Catch (Exception exception=null, [CallerMemberName]string callfunc=null) |
C#: → C-API convert a programming-language-error into an csmkkernel error … | |
void | Cleanup ([CallerMemberName]string callfunc=null, [CallerLineNumber]int callline=-1) |
C#: → C-API cleanup and print unwanted active error … | |
void | Println (string msg="", [CallerMemberName]string callfunc=null, [CallerLineNumber]int callline=-1) |
C#: → C-API print the default-error to the MkLogFileC (default: stderr) and clear the error afterwards … | |
void | Reset ([CallerMemberName]string callfunc=null, [CallerLineNumber]int callline=-1, bool force=false) |
C#: → C-API This function clears the err and resets to MK_OK … | |
MkErrorE | Stack ([CallerMemberName]string callfunc=null, [CallerFilePath]string callfile=null, [CallerLineNumber]int callline=-1) |
C#: → C-API check on error and if yes append an ErrorStackFormat to the error-message … | |
void | StackFormat ([CallerMemberName]string callfunc=null, [CallerFilePath]string callfile=null, [CallerLineNumber]int callline=-1) |
C#: → C-API append an ensemble of func, file and line to the error-message … | |
MkErrorC | NoRaise () |
C#: → C-API ignore the next return of MK_ERROR and do not raise an target-language-exception … | |
void | AppendC (string message) |
C#: → C-API append the message to the MkErrorS::text … | |
void | Raise () |
C#: → C-API convert an csmkkernel error into an programming-language-error and raise afterwards. … | |
void | SetC (string message, [CallerMemberName]string callfunc=null, int errnum=-1) |
C#: → C-API 'set' and 'raise' the MkErrorC using a string-message and a errnum-number … | |
bool | IsABORT () |
C#: → C-API check on ABORT signal … | |
bool | IsEXIT () |
C#: → C-API check on APPLICATION-EXIT error … | |
bool | IsSOCKET () |
C#: → C-API check on SOCKET-DOWN error … | |
bool | IsTIMEOUT () |
C#: → C-API check on TIMEOUT error … | |
void | SetABORT (string detail="UNKNOWN", [CallerMemberName]string callfunc=null) |
C#: → C-API send the ABORT signal to the calling stack… | |
void | SetCONTINUE () |
C#: → C-API signal end of processing in an MqMqEventIF callback … | |
void | SetCode (MkErrorE code) |
C#: → C-API set the MkErrorS::code value … | |
void | SetEXIT ([CallerMemberName]string callfunc=null) |
C#: → C-API finish the current callback, return to toplevel and MqExit the application … | |
void | SetSOCKET (string detail="UNKNOWN", [CallerMemberName]string callfunc=null) |
C#: → C-API create SOCKET-DOWN error … | |
MkErrorC | Dup () |
C#: → C-API Dup-Constructor - create a new MkErrorC instance as copy from an existing MkErrorC instance … | |
void | Copy (MkErrorC srce) |
C#: → C-API Copy-Constructor - sync an existing MkErrorC instance with the values from an existing MkErrorC instance … | |
![]() | |
delegate void | MkObjectDeleteSCB (string typeName, int typeHdl, int objHdl) |
implements the csmkkernel API object: public version from MkObjectDeleteSCB as method | |
void | ErrorCheck (MkErrorE err) |
bool | Check () |
string | ToNameOfClass () |
C#: → C-API Class-Slot - returns the C#-Class-Name of the obj as string | |
void | HandleDelete () |
C#: → C-API Handle-Delete-Slot - delete a netObj from handle-storage … | |
bool | HandleExists () |
C#: → C-API check if obj has already a handle defined… | |
Int32 | HandleGet () |
C#: → C-API Handle-Get-Slot - returns a export-hdl to the MkObjectC useable for external storage | |
Int32 | HandleGetOfType () |
C#: → C-API Export-Slot - returns typeHdl of the obj . | |
Int32 | HandleGetOr0 () |
C#: → C-API return export-hdl or 0 in not created… | |
MkObjectC | Next () |
C#: → C-API get next instance from linked-list of MkObjectS type | |
MkObjectC | Prev () |
C#: → C-API get previous instance from linked-list of MkObjectS type | |
void | DbgDump (string message="var", [CallerMemberName]string callfunc=null) |
C#: → C-API debug: Dump a instance to stderr with LNG and MQ internal data… | |
void | DbgL (string message, int debug=0, [CallerMemberName]string callfunc=null, int lvl=0) |
C#: → C-API debug: write a instance-marker to the MkLogFileC (default: stderr) using the fmtobj as prefix … | |
void | DbgLogC ([CallerMemberName]string callfunc=null) |
C#: → C-API debug: write a short-obj-summary to MkLogFileC (default: stderr) … | |
void | DbgO ([CallerMemberName]string callfunc=null) |
C#: → C-API debug: write the object-details to MkLogFileC (default: stderr) … | |
void | DbgSTACK (int skip=0, int num=-1, [CallerMemberName]string callfunc=null) |
C#: → C-API debug: write the stack-trace to MkLogFileC (default: stderr) … | |
void | LogC (string message, int debug=0, [CallerMemberName]string callfunc=null) |
C#: → C-API write a logging-message to MkLogFileC (default: stderr) using the internal format … | |
void | LogHEX (string callfunc, byte[] data) |
C#: → C-API log binaray data as HEX into the MkLogFileC (default: stderr) … | |
void | Log (MkObjectC fmtobj=null, int debug=0, [CallerMemberName]string callfunc=null, int lvl=0) |
C#: → C-API Log-Slot - log a summary of an object to the MkLogFileC (default: stderr) target … | |
void | LogLong (MkObjectC fmtobj=null, int debug=0, [CallerMemberName]string callfunc=null, int lvl=0) |
C#: → C-API log the MkObjectS verbose into the MkLogFileC (default: stderr) … | |
void | LogShort (MkObjectC fmtobj=null, int debug=0, [CallerMemberName]string callfunc=null, int lvl=0) |
C#: → C-API log the MkObjectS into the MkLogFileC (default: stderr) … | |
void | LogType (MkObjectC fmtobj=null, int debug=0, [CallerMemberName]string callfunc=null, int lvl=0) |
C#: → C-API log the tyoe of the MkObjectS into the MkLogFileC (default: stderr) … | |
MkErrorC | ErrorCatch (Exception exception=null, [CallerMemberName]string callfunc=null) |
C#: → C-API convert a programming-language-error into an csmkkernel error … | |
MkErrorC | ToError () |
C#: → C-API Error-Slot - return an error-object pre initialized with obj data. | |
bool | IsNull () |
C#: → C-API ckeck if the object is null | |
string | ToName () |
C#: → C-API Info-Slot - returns brief information about the obj as a string | |
string | ToNameOfType () |
C#: → C-API Type-Slot - returns the LibMkKernel-Type-Name of the obj as a string | |
override string | ToString () |
C#: → C-API String-Slot - returns the string representation of the inst … | |
int | RefGet () |
MkRefGetP | |
void | SysKill (int pid, int signal) |
MkSysKill | |
int | SysGetPid () |
MkSysGetPid | |
void | Dispose () |
C#: → C-API Dispose-Slot - untie the connection between the Native-C#-Instance and the csmkkernel-Instance. | |
void | Delete () |
C#: → C-API Delete-Slot - delete an instance. | |
Static Public Member Functions | |
static MkErrorC | MkErrorC_ObjNew (IntPtr hdl) |
static void | Check (IntPtr ctx, MkErrorE err) |
static void | Check (MkErrorE err) |
static MkErrorE | Stack (IntPtr mkrt, IntPtr hdl, [CallerMemberName]string callfunc=null, [CallerFilePath]string callfile=null, [CallerLineNumber]int callline=-1) |
C#: → C-API check on error and if yes append an ErrorStackFormat to the error-message … | |
static MkErrorE | StackFull (IntPtr mkrt, IntPtr hdl) |
C#: → C-API check on error and if yes append an ErrorStackFormat to the error-message … | |
new static MkErrorC | HandleResolve (Int32 netHdl) |
C#: → C-API Handle-Resolve-Slot - return a MkErrorC from netHdl or null if invalid… | |
new static MkErrorC | Instances () |
C#: → C-API get head-instance from linked-list of MkErrorS type … | |
new static MkErrorC | GetNull () |
C#: → C-API Null-Slot - return a MkErrorC typed NULL instance … | |
static void | PanicC (MkObjectC fmtobj, string callfunc, int errnum, string message) |
C#: → C-API do a panic with string as argument … | |
static void | PanicDEFAULT (MkObjectC fmtobj=null, [CallerMemberName]string callfunc=null) |
C#: → C-API make panic from MkErrorDEFAULT_RT … | |
static MkErrorC | DEFAULT () |
C#: → C-API default-system-error - default-error … | |
static MkErrorC | FORMAT (MkObjectC fmtobj=null) |
C#: → C-API system-error-format - format and return the default-error … | |
static MkErrorC | IGNORE () |
C#: → C-API ignore-system-error - ignore the next error … | |
static MkErrorC | PRINT () |
C#: → C-API ignore-system-error - print the next error into MkLogFileC … | |
![]() | |
static MkObjectC | MkObjectC_ObjNew (IntPtr hdl) |
static IntPtr | getOBJ (string cls, MkObjectC obj) |
static IntPtr | getOBJ_null_allow (MkObjectC obj) |
static MkObjectC | HandleResolve (Int32 netHdl) |
C#: → C-API Handle-Resolve-Slot - return a MkObjectC from netHdl or null if invalid… | |
static void | HandleDeleteByNetHdl (Int32 netHdl) |
C#: → C-API Handle-Delete-Slot - delete a netHdl from handle-storage … | |
static MkObjectC | Instances () |
C#: → C-API get head-instance from linked-list of MkObjectS type … | |
static MkObjectC | GetNull () |
C#: → C-API Null-Slot - return a MkObjectC typed NULL instance … | |
static void | DbgM (string message, int debug=0, [CallerMemberName]string callfunc=null, int lvl=0) |
C#: → C-API debug: write a static-marker to the MkLogFileC (default: stderr) … | |
static int | SysHashI32 (string key, int length=-1) |
MkSysHashI32 | |
static string | SysHashSTR (string key, int length=-1) |
MkSysHashSTR | |
static void | DeleteCallbackCleanup (string ident) |
C#: → C-API cleanup the DeleteCallback installed with MkObjectDeleteCallbackSetup … | |
static void | DeleteCallbackSetup (string ident, MkObjectDeleteSCB callback=null, string filter=null) |
C#: → C-API Create/Delete the instance-delete-callback … | |
static int | getPId () |
static int | getTId () |
static string | getStackTrace (int level=2) |
static string | getCallerProc (int level=2) |
static int | getCallerLine (int level=2) |
static string | getCallerFile (int level=2) |
Additional Inherited Members | |
![]() | |
MkObjectC (IntPtr obj) | |
MkObjectC () | |
virtual void | Dispose (bool disposing) |
Support IDisposable. | |
![]() | |
static object | atomObjNew (Type type, ConstructorInfo ctor, IntPtr obj) |
static object | atomObjCreate (Type type, ConstructorInfo ctor, IntPtr obj) |
static IntPtr | atomSelfCreate (ConstructorInfo ctor, IntPtr obj, IntPtr env) |
static object | atomSelfNull (ConstructorInfo ctor) |
static void | atomSelfUnlink (IntPtr self, IntPtr env) |
static ConstructorInfo | getCtor (Type type) |
static string | Name (IntPtr mkrt, IntPtr obj) |
C#: → C-API Info-Slot - returns brief information about the obj as a string | |
![]() | |
IntPtr | pmkrt = IntPtr.Zero |
![]() | |
![]() | |
![]() | |
IntPtr | hdl [get, set] |
IntPtr | hdl_null_allow [get, set] |
IntPtr | mkrt [get, set] |
MkErrorC - the class known as err or error is used to create and manage an error message …
An error is a singleton object per thread created at startup and is located at MkRuntimeRLS using the datatype MkErrorC.
As error-indicator the enum MkErrorE is used.
The MkErrorC is used to collect all data needed to handle an error and provide global ressources required to process and report the error.
The MkErrorC is also used to integrate the error-handling from csmkkernel into the error-handling-code of the target C#.
Example from Filter6.cs
→ use MqContextErrorCatch to convert a C# error into a csmkkernel error
public static void Main(string[] argv) { Filter6 srv = MqFactoryCT<Filter6>.Add().New(); try { srv.LinkCreate(argv); srv.ProcessEvent(MqWaitOnEventE.FOREVER); } catch (Exception ex) { srv.ErrorCatch (ex); } srv.Exit(); }
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.
Checks if Exception is of type MkExceptionC and returns true or false …
Example: test case to check KILL and RECOVER feature, check on MkExceptionC
var VAL = ReadBUF(); mycl = new Client(); mycl.LinkCreate(ConfigGetStartAs()); var PID = (int) mycl.Send("W", "GPID@I"); int RET=0; SysKill(PID,9); for (int i = 0; i < 3; i++) { try { RET = (int) mycl.Send("W", "ECOI:U@I", VAL); } catch (MkExceptionC ex) { var err = mycl.ErrorCatch(ex); if (err.IsSOCKET()) { err.Reset(); mycl.LinkConnect(); continue; } else { err.Raise(); } } break; } SendSTART(); SendI32(RET);
[in] | exception | the exception object from C#, if null the global exception object is used |
Definition at line 498 of file MkErrorC.cs.
|
inlinestatic |
Definition at line 74 of file MkErrorC.cs.
|
inlinestatic |
Definition at line 80 of file MkErrorC.cs.
|
inlinestatic |
Definition at line 38 of file MkErrorC.cs.
|
inlinestatic |
C#:
→ C-API MkErrorE err.Stack([CallerMemberName]string callfunc = null, [CallerFilePath]string callfile = null, [CallerLineNumber]int callline = -1)
check on error and if yes append an ErrorStackFormat to the error-message …
Definition at line 85 of file MkErrorC.cs.
|
inlinestatic |
C#:
→ C-API MkErrorE err.Stack([CallerMemberName]string callfunc = null, [CallerFilePath]string callfile = null, [CallerLineNumber]int callline = -1)
check on error and if yes append an ErrorStackFormat to the error-message …
Definition at line 101 of file MkErrorC.cs.