RETHROW

Statement

Syntax

Sends the error being handled in a CATCH on to the next enclosing TRY, unchanged.

RETHROW

Good to know

  • Allowed only inside a CATCH, or in a block nested in a CATCH. Anywhere else: "RETHROW requires an active CATCH block".
  • It takes no value: "RETHROW does not accept a value". It works even after a bare CATCH with no variable.
  • The FINALLY of the same TRY runs before the outer CATCH.
  • Unlike THROW e, the error keeps its name, code and command.

Example

TRY  TRY    THROW "disk full"  CATCH inner$    Console("inner: " + inner$)        ' inner: disk full    RETHROW  FINALLY    Console("inner finally")           ' inner finally  ENDTRYCATCH outer  Console("outer: " + outer.message)   ' outer: disk fullENDTRY
In the manual : Errors

See also