79744781

Date: 2025-08-24 10:10:30
Score: 0.5
Natty:
Report link

On Error Goto -1 raises the error to the prior scopes error handler, so On Error Goto 0 would error on the current scope as it happens, but -1 sends it to the callee's scope error handlers. So, say you have Function1 calling Function2, if within Function2 any error handling ends out with On Error Goto -1 and then errors, Function1's error handling gets the error, and it would be marked on the actual call to Function2. On Error Goto 0 with in either function before Function2 causes an error, would stop where Function2 occurs the error. Function2 might have its own error handling and never let Function1 know, then again it could sum up with calls it will want Function1 to handle as being just Function2 as the error if it happens. You can On Error Goto -1 and Err.Raise right after to control what is considerably the error to the callee. No error handling prior at any executing point in the application from the beginning makes On Error Goto -1 is similar to On Error Goto 0 in that Sub Main threw the exception and that is the environment handling it no different to On Error Goto 0.

It's a clever line number similar to like NSIS does -1, but it sends to the function call scope, not technically the prior line least error handling.

Reasons:
  • Long answer (-1):
  • No code block (0.5):
  • Low reputation (1):
Posted by: Nicholas Forystek