ePages 6.10 - DE_EPAGES/Core/API/Script.pm

Package DE_EPAGES::Core::API::Script

This module provides error handling for scripts.

@EXPORT_OK
RunScript

Functions

HandleSignal
RunScript

HandleSignal

This function will be called when a signal (USR1, USR2, INT, QUIT) is received. It writes the current caller stack to the file $ENV{EPAGES_LOG}/usr.log. If the signal USR2 or INT is received the process will be terminated.

Syntax
HandleSignal($signal)
Input
$signal (string)
signal name of the received signal

RunScript

Runs the main function in the context of the Error module and enables detailed error information.

Syntax
RunScript(%Options);
Example
RunScript( Sub => \&Main, 'Message'=>'short');
Input
%Options (hash)
options keys :
  • Sub - a code reference of the main function - code ref
  • Message -(optional) select error informatio
    (long/short/message default=message) - string
  • Debug -(optional) enables extended error information with stack
    trace using DE_EPAGES::Core::API::Error::longMessage
    overwrites key Message - boolean
  • LogConfig -(optional) path to the log4perl.conf file,
    default: $ENV{EPAGES_CONFIG}/log4perl.conf - string