I know this is not the way to do it, and it isn’t clean at all. I just wonder if it’s possible.
If I have a class with a bunch of methods
public class Foo {
methodA() {}
methodB() {}
methodC() {}
}
Is it possible to catch all exceptions that could possibly occur without having to write a try/catch in each method?
Yes it is. The simplest way would be a Attribute for this class like this one:
Usage (untested cause I used it in context of controller that already implement all required interfaces)
Or you can do something like this:
And use it in a Function body: