You can add a new CATCH block to an existing TRY CATCH statement. This enables you to handle another exception in an existing TRY CATCH statement.
Example
Before Execution | After Execution |
---|---|
To copy the source code example, click here Code Example Before Execution |
|
In the implementation of the drive method, the check_engine method is called. This method can raise exceptions of the type cx_failure. The exception now needs be handeld in a new CATCH block. |
In the drive method, the new CATCH block is added where the cx_failure exception can now be handled. |