Skip to end of metadata
Go to start of metadata

To handle exceptions in Boo you use the try - except block, and an optional ensure keyword, which may be used to have some code executed no matter the exception was raised or not. Just for a comparative, it is equivalent to try - catch - finally block from C# or Java.

Executes some code with exception handling:

to raise exceptions, use the raise keyword:

You can also handle specific Exception types using the form

as in

Using ensure to do some clean-up, post-executing action etc...:

  • No labels