I wanted to know, if there is a way to throw User Exceptions from MFP 8 Java Adapter to Client. I tried to throw some exceptions from the server and I get a common error. "Unexpected error... check server". Is there a way where we can throw exceptions to the client, so that it can be handled at the client in the failure blocks?
Only if there is a server crash, it is handled in the failure block of the client API methods.
Java adapters in MobileFirst Foundation 8.0 are essentially JAX-RS applications. As such you can use the " exception mapper " concept in JAX-RS to define custom responses.
Read more in the JAX-RS documentation: http://cxf.apache.org/docs/jax-rs-basics.html#JAX-RSBasics-Exceptionhandling
You can also find various examples online.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.