I have a block of code which can throw & catch errors like so
try { } catch (e: FooException) { } catch (e: B