Exceptions/Catch an exception thrown in a nested call: Difference between revisions
Content added Content deleted
(+ AutoHotkey) |
m (→{{header|AutoHotkey}}: Minor indentation and casing edit) |
||
Line 134:
Here is one way to keep track of nested errors:
<lang AutoHotkey>foo()
Return
foo()
{
bar(0)
bar(1)
}
bar(i)
{
StringReplace, ErrorLevel, ErrorLevel, baz_error, , All ; clear baz_error(s)
ErrorLevel .= "baz_error" ; add baz_error to errorstack
}
baz(i)
{
StringReplace, ErrorLevel, ErrorLevel, U1, , All ; clear U1 errors
StringReplace, ErrorLevel, ErrorLevel, U0, , All ; clear U0 errors
Else
Return 1
}</lang>
|