Throw custom exception from Java action

1
Hello, I have custom exception which contains error code and some other information, I want to throw this exception from java action, and I want to handle it from mendix & use the custom values, for example: there is something called $lastErrorMessage. I want to use my own, like $errorCode (which is not available by default). Best regards. Bassel Kh.
asked
3 answers
0

In the community commons there is a java action that will throw an exeception when called. You could have a look at that to provide the java action with your error data and then use that as the action.

answered
0

Why not always give also your own error code back to Mendix as a mendixObject? You only have to modify all your exceptions in java so that you then also return the mendixObjects.

answered
0

Maybe you can put in- and parse the errorcode from the exception message? (You can use a dedicated microflow / java action with basic string operations for that.

answered