theKernel 10.0
Loading...
Searching...
No Matches
MkErrorC_TCL_API

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

+ Collaboration diagram for MkErrorC_TCL_API:

Topics

 MkErrorC_Class_TCL_API
 MkErrorC - define the class …
 
 MkErrorC_TOR_TCL_API
 MkErrorC - various functions to 'create' and 'delete' a MkErrorS
 
 MkErrorC_System_TCL_API
 MkErrorC - various functions to raise a 'System' messagen on MkErrorS
 
 MkErrorC_Signal_TCL_API
 MkErrorC - various functions to set and check a 'signal' on a MkErrorS
 
 MkErrorC_Get_TCL_API
 MkErrorC - various functions to 'get' data out of a MkErrorS
 
 MkErrorC_Raise_TCL_API
 MkErrorC - various functions to 'raise' a MkErrorS
 
 MkErrorC_Misc_TCL_API
 MkErrorC - various functions to 'work' on a MkErrorS
 

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 tclmkkernel into the error-handling-code of the target Tcl.

Example from Filter6.tcl use MqContextErrorCatch to convert a Tcl error into a tclmkkernel error

tclmqmsgque::Main {
  set srv [[MqFactoryC Add Filter6] New]
  try {
    $srv LinkCreate {*}$argv
    $srv ProcessEvent MQ_WAIT_FOREVER
  } on error {} {
    $srv ErrorCatch
  } finally {
    $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

          set VAL   [my ReadBUF]
          set cl    [Client new]
          $cl myLinkCreate [my ConfigGetStartAs]
          $cl Send "W" "GPID@I" PID
          my SysKill $PID 9
          set RET 0
          foreach num {1 2 3} {
            try {
              set RET [$cl Send "W" "ECOI:U@I" $VAL]
            } trap {MkExceptionC} "" {
              set err [$cl ErrorCatch]
              if {[$err IsSOCKET]} {
                $err Reset
                $cl LinkConnect
                continue
              } else {
                $err Raise
              }
              $err Delete
            }
            break
          }
          my SendSTART
          my SendI32 $RET
Returns
the result of the check, true or false
Parameters
[in]exceptionthe exception object from Tcl, if "MK_NULL" the global exception object is used