Class ResourceException

java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
javax.ws.rs.WebApplicationException
com.onenetwork.platform.integ.rest.ResourceException
All Implemented Interfaces:
java.io.Serializable

public class ResourceException
extends javax.ws.rs.WebApplicationException
An exception which can be thrown from a resource and will result in a json message the client can consume with a user-friendly error message.

There is already a default exception mapper which takes care of mapping *unexpected* exceptions to something the client can consume, so ResourceException is intended to be thrown only when we want to intentionally send back a 200 with success : false.

See Also:
Serialized Form
  • Constructor Summary

    Constructors 
    Constructor Description
    ResourceException​(java.lang.String message)  
    ResourceException​(java.lang.String message, java.lang.Throwable t)  
    ResourceException​(java.lang.String message, java.lang.Throwable t, org.json.JSONObject data)  
    ResourceException​(java.lang.String message, org.json.JSONObject data)  
    ResourceException​(java.lang.Throwable t)  
  • Method Summary

    Modifier and Type Method Description
    java.lang.String getMsg()  
    javax.ws.rs.core.Response getResponse()  

    Methods inherited from class java.lang.Throwable

    addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

  • Method Details

    • getResponse

      public javax.ws.rs.core.Response getResponse()
      Overrides:
      getResponse in class javax.ws.rs.WebApplicationException
    • getMsg

      public java.lang.String getMsg()
      Returns:
      the user-friendly error message