SOMError: Difference between revisions
Created page with "This functions handles an error condition. ==Syntax== <PRE> int errorCode; string fileName; int lineNum; SOMError(errorCode, fileName, lineNum); </PRE> ==Par..." |
mNo edit summary |
||
(One intermediate revision by one other user not shown) | |||
Line 11: | Line 11: | ||
==Parameters== | ==Parameters== | ||
; errorCode (int) : An integer representing the error code of the error. | ;errorCode (int) : An integer representing the error code of the error. | ||
; fileName (string) : The name of the file in which the error occurred. | ;fileName (string) : The name of the file in which the error occurred. | ||
; lineNum (int) : The line number where the error occurred. | ;lineNum (int) : The line number where the error occurred. | ||
==Return Code== | ==Return Code== | ||
==Remarks== | ==Remarks== | ||
This function inspects the specified error code and takes appropriate action, depending on the severity of the error. The last digit of the error code indicates whether the error is classified as SOM_Fatal (9), SOM_Warn (2), or SOM_Ignore (1). The default implementation of this function prints a message that includes the specified error code, filename, and line number, and terminates the current process if the error is classified as SOM_Fatal. The fileName and lineNum arguments specify where the error occurred. This routine can be replaced by changing the value of the global variable SOMError. | This function inspects the specified error code and takes appropriate action, depending on the severity of the error. The last digit of the error code indicates whether the error is classified as SOM_Fatal (9), SOM_Warn (2), or SOM_Ignore (1). The default implementation of this function prints a message that includes the specified error code, filename, and line number, and terminates the current process if the error is classified as SOM_Fatal. The fileName and lineNum arguments specify where the error occurred. This routine can be replaced by changing the value of the global variable SOMError. | ||
For C and C++ programmers, SOM defines a convenience macro, SOM_Error, which invokes this function and supplies the last two arguments. | For C and C++ programmers, SOM defines a convenience macro, SOM_Error, which invokes this function and supplies the last two arguments. | ||
==Related== | ==Related== | ||
===Macros=== | ===Macros=== | ||
* SOM_Test | * [[SOM_Test]] | ||
* SOM_TestC | * [[SOM_TestC]] | ||
* SOM_WarnMsg | * [[SOM_WarnMsg]] | ||
* SOM_Assert | * [[SOM_Assert]] | ||
* SOM_Expect | * [[SOM_Expect]] | ||
* SOM_Error | * [[SOM_Error]] | ||
[[Category:SOM Kernel]] | [[Category:SOM Kernel]] |
Latest revision as of 01:43, 6 May 2020
This functions handles an error condition.
Syntax
int errorCode; string fileName; int lineNum; SOMError(errorCode, fileName, lineNum);
Parameters
- errorCode (int)
- An integer representing the error code of the error.
- fileName (string)
- The name of the file in which the error occurred.
- lineNum (int)
- The line number where the error occurred.
Return Code
Remarks
This function inspects the specified error code and takes appropriate action, depending on the severity of the error. The last digit of the error code indicates whether the error is classified as SOM_Fatal (9), SOM_Warn (2), or SOM_Ignore (1). The default implementation of this function prints a message that includes the specified error code, filename, and line number, and terminates the current process if the error is classified as SOM_Fatal. The fileName and lineNum arguments specify where the error occurred. This routine can be replaced by changing the value of the global variable SOMError.
For C and C++ programmers, SOM defines a convenience macro, SOM_Error, which invokes this function and supplies the last two arguments.