WoW:API seterrorhandler: Difference between revisions
Jump to navigation
Jump to search
(New page: {{wowapi}} __NOTOC__ <!-- Describe the purpose of the function, exhausting detail can be saved for a later section --> Sets the function to be called when WoW encounters an error. <!-- ...) |
(formatting, example) |
||
Line 1: | Line 1: | ||
{{wowapi}} __NOTOC__ | {{wowapi}} __NOTOC__ | ||
Sets the function to be called when WoW encounters an error. | Sets the function to be called when WoW encounters an error. | ||
seterrorhandler(errFunction) | |||
== Arguments == | |||
; errFunction: Function - The function to call when an error occurs. The function is passed a single argument containing the error message. | |||
== Example == | |||
If you wanted to print all errors to your chat frame, you could do: | |||
seterrorhandler(print); | |||
Alternatively, the following would also perform the same task: | |||
seterrorhandler(function(msg) | |||
print(msg); | |||
end); | |||
[[Category:World of Warcraft API]] | [[Category:World of Warcraft API]] |
Revision as of 01:54, 12 August 2009
Sets the function to be called when WoW encounters an error.
seterrorhandler(errFunction)
Arguments
- errFunction
- Function - The function to call when an error occurs. The function is passed a single argument containing the error message.
Example
If you wanted to print all errors to your chat frame, you could do:
seterrorhandler(print);
Alternatively, the following would also perform the same task:
seterrorhandler(function(msg) print(msg); end);