2018-12-30 16:43:04 -08:00
|
|
|
---
|
|
|
|
|
title: master / error_handler
|
|
|
|
|
---
|
2023-11-25 09:50:24 -08:00
|
|
|
# error_handler
|
2018-12-30 16:43:04 -08:00
|
|
|
|
|
|
|
|
### NAME
|
|
|
|
|
|
2018-12-30 16:59:01 -08:00
|
|
|
error_handler - function in master object to handle errors
|
2018-12-30 16:43:04 -08:00
|
|
|
|
|
|
|
|
### SYNOPSIS
|
|
|
|
|
|
2018-12-30 16:59:01 -08:00
|
|
|
void error_handler( mapping error, int caught );
|
2018-12-30 16:43:04 -08:00
|
|
|
|
|
|
|
|
### DESCRIPTION
|
2018-12-30 16:59:01 -08:00
|
|
|
|
2018-12-30 16:43:04 -08:00
|
|
|
This function allows the mudlib to handle errors instead of the driver.
|
|
|
|
|
The contents of the 'error' mapping are:
|
|
|
|
|
|
2019-10-19 01:03:49 -07:00
|
|
|
([
|
|
|
|
|
"error" : string, // the error
|
|
|
|
|
"program" : string, // the program
|
|
|
|
|
"object" : object, // the current object
|
|
|
|
|
"line" : int, // the line number
|
|
|
|
|
"trace" : mapping* // a trace back
|
|
|
|
|
])
|
2018-12-30 16:43:04 -08:00
|
|
|
|
|
|
|
|
Each line of traceback is a mapping containing the following:
|
|
|
|
|
|
2019-10-19 01:03:49 -07:00
|
|
|
([
|
|
|
|
|
"function" : string, // the function name
|
|
|
|
|
"program" : string, // the program
|
|
|
|
|
"object" : object, // the object
|
|
|
|
|
"file" : string, // the file to which the line number refers
|
|
|
|
|
"line" : int // the line number
|
|
|
|
|
])
|
2018-12-30 16:43:04 -08:00
|
|
|
The 'caught' flag is 1 if the error was trapped by catch().
|
|
|
|
|
|
|
|
|
|
### SEE ALSO
|
|
|
|
|
|
2018-12-30 16:59:01 -08:00
|
|
|
catch(3), error(3), throw(3), log_error(4)
|
2018-12-30 16:43:04 -08:00
|
|
|
|
|
|
|
|
### AUTHOR
|
|
|
|
|
|
2018-12-30 16:59:01 -08:00
|
|
|
Beek
|
2019-10-19 01:03:49 -07:00
|
|
|
|