You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We are unable to access serialized exception in the catch block via J4pRemoteException. J4pRemoteException does not include any functionality related to "error_value" field neither does processing of json response in org.jolokia.client.J4pClient (method: private J4pRemoteException validate(T pRequest, JSONObject pJsonRespObject)).
We would like the J4pRemoteException to provide either the whole json response object it was created from or just the "error_value" field as string so we can rebuild/rethrow the original exception .
If you agree and decide to provide this functionality, we are willing to implement it.
The text was updated successfully, but these errors were encountered:
You are right, I forgot to adapt the Java Client's exception handling. What I could imagine is to add a JSONObject getErrorValue() Method to J4pRemoteException which returns the (parsed) serialized exception if this option is set. This would fit nicely to the current API which uses also already parsed JSONObjects for the return values (and not plain strings). The change is probably not much more than to change the constructor of J4pRemoteException and add a property (the exception is already parsed as a JSON object at that time).
Maybe for the Java Client Lib we could go even further and allow for ExceptionHandlers to be registered in the J4pClient so that sort of translation could be done automatically (but then probably only for RuntimeExceptions).
But that's something which should be thinked about later.
If you like, you can implement it (assumed that you release it under the APL) and send me a pull request. I would happily integrate it. Please don't forget some unit-tests (there are already quite some from which you can take as blueprint) 😄 and, optionally, adapt the documentation in src/docbkx/client/java.xml