- Function errh::Adapt(err, severity, message, category, code)
errh::Adapt
The procedure errh::Adapt adapts an error with the specified
information.
errh::Adapt(
   err,       ! (input) an element
   severity,  ! (optional input) an element
   message,   ! (optional input) a string
   category,  ! (optional input) an element
   code       ! (optional input) an element
)
Arguments
- err
An element in the set
errh::PendingErrorsreferencing an error.- severity
An element in the set
errh::AllErrorSeverities.- message
A string describing the problem and possibly suggestions for repairing the problem.
- category
An element in the set
errh::AllErrorCategories, indicating the problem category to which the error belongs.- code
An element with root set
errh::ErrorCodes. The element will be added to the seterrh::ErrorCodesif needed.
Return Value
Returns 1 if adapting the error is successful, 0 otherwise. In the latter case additional error(s) have been raised.
Note
When err does not reference an error in the set errh::PendingErrors an
additional error will be raised. If the current filter is the filter
To Global Collector an additional error will be raised.
Example
1block
2    pr_divideByZero();
3onerror _ep_err do
4    errh::Adapt(
5        err      :  _ep_err,
6        message  :  "Don't worry, be happy" );
7endblock ;
Lines 4-6 adapt the message of the error thrown by pr_divideByZero to "Don't worry, be happy"