EndException: Is it correct how I caught the RunTime error?

Hi everyone.
I have the following code:

'..... end of my code .....
Exception err As IOException
  MessageBox("ERROR: " + error.Message + EndOfLine + "Error num: " + Str(error.ErrorNumber))
  Quit

//HERE MY DOUBT:
Exception error As RuntimeException
  If error IsA EndException Or errot IsA ThreadEndException Then
    Raise error
  End If
  MessageBox("ERROR: " + error.Message + EndOfLine + "Error num: " + Str(error.ErrorNumber))
  Quit

I cannot use the following method because it is not correct:

Exception error As RuntimeException
      MessageBox("ERROR: " + error.Message + EndOfLine + "Error num: " + Str(error.ErrorNumber))
      Quit

The Exception documentation recommends this:

Exception err As RuntimeException // Will catch any exception without discrimination
  If err IsA EndException Or err IsA ThreadEndException Then
    Raise err // Re-raise the exception
  End If
  //Continue your code here

Is my MessageBox being intercepted correctly??
It makes me confused having to release the error again: Raise error

Exception error As RuntimeException
  If error IsA EndException Or errot IsA ThreadEndException Then
    Raise error
  End If
  MessageBox("ERROR: " + error.Message + EndOfLine + "Error num: " + Str(error.ErrorNumber))
  Quit

err <> error

If error IsA EndException Or errot IsA ThreadEndException Then

i think if you raise this error its like throw in c#

and its usually not necessary to quit a app on error.

Just try catch the error instead when you have multiple different exception types to catch

Raise error exits the method immediately. The messagebox will not be executed if you re-raise the exception. For any other exception, you will get the messagebox.

That said, you need to do something about the exception. Some you can ignore and those should be the ones you are catching explicitly. Exceptions that you don’t anticipate and code for should not be caught. Therefore, I agree with Derk - only catch the ones you know what to do about.

Ok. I get it.
Thanks everyone for the clarification.