WoW:API seterrorhandler: Difference between revisions

From AddOn Studio
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. <!-- ...)
 
m (Move page script moved page API seterrorhandler to API seterrorhandler without leaving a redirect)
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
{{wowapi}} __NOTOC__
{{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.
Sets the function to be called when WoW encounters an error.
seterrorhandler(errFunction)


<!-- List return values and arguments as well as function name, follow Blizzard usage convention for args -->
== Arguments ==
seterrorhandler(errfunc)
; errFunction: Function - The function to call when an error occurs. The function is passed a single argument containing the error message.
 
== Parameters ==
=== Arguments ===
<!-- List each argument, together with its type -->
:;errfunc: [[errfunc]] - The function to be used as the error callback
 
=== Source ===


Information gleaned from looking at the source of [http://auctioneeraddon.com/dl/Swatter/ Swatter]
== 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]]

Latest revision as of 04:47, 15 August 2023

WoW API < seterrorhandler

Sets the function to be called when WoW encounters an error.

seterrorhandler(errFunction)

Arguments[edit]

errFunction
Function - The function to call when an error occurs. The function is passed a single argument containing the error message.

Example[edit]

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);