• Increase font size
  • Default font size
  • Decrease font size
Home Software SysFunc Sysfunc Reference Guide - Error handling

Sysfunc Reference Guide - Error handling

E-mail Print
Read : 3,389 times
(0 votes, average 0 out of 5)
Article Index
Sysfunc Reference Guide
Configuration parameters
System database
Disk management
Error handling
File manipulation
Filesystems
IP V4 addresses
Kernel
Logical volume manager
Miscellaneous
Message display
User interaction
Network
OS
File backup
Software packages
Services
Time and date
Temporary file management
Users and groups
Vmware-specific
Function index
All Pages

error

Displays an error message

If the SF_ERRLOG environment variable is set, it is supposed to contain a path. The error message will be appended to the file at this path. If the file does not exist, it will be created.

Arguments

$1 Message

Returns

Always 0

Displays

Error message

error_count

Display a count of errors detected so far

Arguments

None

Returns

Always 0

Displays

Error count

error_import

Import errors into the error system

This mechanism is generally used in conjunction with the $SF_ERRLOG variable. This variable is used to temporarily distract errors from the normal flow. Then, this function can be called to reinject errors into the default error repository.

Arguments

$1 Optional. File to import (1 error per line). If not set, takes input from stdin.

Returns

Always 0

Displays

Nothing

fatal

Displays an error message and aborts execution

Arguments

$1 message
$2 Optional. Exit code.

Returns

Does not return. Exits with the provided exit code if arg 2 set, with 1 if not.

Displays

Error and abort messages

show_errors

Display a list of errors detected so far

Arguments

None

Returns

Always 0

Displays

List of error messages, one by line

unsupported

Fatal error on unsupported feature

Call this function when a feature is not available on the current operating system (yet ?)

Arguments

$1 feature name

Returns

Does not return. Exits with code 2.

Displays

Error and abort messages

 

Please login or register to add a comment