theKernel 10.0
Loading...
Searching...
No Matches
MkErrorC_CS_API

MkErrorC - the class known as err or error is used to create and manage an error message … More...

+ Collaboration diagram for MkErrorC_CS_API:

Topics

 MkErrorC_Class_CS_API
 MkErrorC - define the class …
 
 MkErrorC_TOR_CS_API
 MkErrorC - various functions to 'create' and 'delete' a MkErrorS
 
 MkErrorC_System_CS_API
 MkErrorC - various functions to raise a 'System' messagen on MkErrorS
 
 MkErrorC_Signal_CS_API
 MkErrorC - various functions to set and check a 'signal' on a MkErrorS
 
 MkErrorC_Get_CS_API
 MkErrorC - various functions to 'get' data out of a MkErrorS
 
 MkErrorC_Raise_CS_API
 MkErrorC - various functions to 'raise' a MkErrorS
 
 MkErrorC_Misc_CS_API
 MkErrorC - various functions to 'work' on a MkErrorS
 

Classes

class  csmkkernel.MkErrorC
 MkErrorC - the class known as err or error is used to create and manage an error message … More...
 

Functions

void csmkkernel.MkObjectC.ErrorCheck (MkErrorE err)
 

Detailed Description

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

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.

Attention

ExceptionCheck

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);
Returns
the result of the check, true or false
Parameters
[in]exceptionthe exception object from C#, if null the global exception object is used

Function Documentation

◆ ErrorCheck()

void csmkkernel.MkObjectC.ErrorCheck ( MkErrorE err)
inline

Definition at line 139 of file MkErrorC.cs.

139 {
140 if (err <= MkErrorE.CONTINUE) return;
141 throw new MkExceptionC(hdl);
142 }
MkErrorE
collection for the different error-codes …
+ Here is the caller graph for this function: