whiz
Senior Member
Posts: 568 Reputation: 8
– / – /
Joined: Nov 2008
|
O.P. RE: [Release] Fake media 1.60
quote: Originally posted by Matti
Perhaps the best way to implement custom exception handling for all your functions, is to wrap the code inside all your event handlers such as OnEvent_Initialize or OnChatWndEvent_Created.
<code>
As you can see, despite being wrapped in other functions, the exception will still reach the try-catch block in the event handler. These are the starting points of your call stacks, so any exception occurring inside a function called from the event will bubble up in the call stack until it hits the try-catch block in your event handler code.
js code: Debugger.Catch = function(Function, Error)
{
Debugger.Trace("/////////////////////////////////////////////////////////////////");
Debugger.Trace("** Error in: " + Function + " **");
Debugger.Trace("Description: " + Error.description + " (" + Error.code + ")");
Debugger.Trace("Error time: " + new Date());
Debugger.Trace("/////////////////////////////////////////////////////////////////");
}
js code: function OnEvent_Initialize(MessengerStart)
{
try
{
Debugger.Call("Initialize", {"MessengerStart" : MessengerStart});
// ...
foo.bar(); // invalid function
}
catch (error)
{
Debugger.Catch("Initialize", error); // line 72
}
}
code: From the Plus! Script Debug...
Error: Object doesn't support this property or method (code: -2146827850)
File: FnInitialization.js. Line: 72.
Function OnEvent_Initialize returned an error. Code: -2147352318
quote: Originally posted by SmokingCookie
Pleaaaaase don't go offtopic, or my thread will be closed
Can someone split it from my first post, please?
|
|