Annotation Type RestException


@Documented
@Target(TYPE)
@Retention(RUNTIME)
public @interface RestException
Any exception thrown by a REST API which includes this annotation will set the supplied errorCode and message as properties on a JSON in the HTTP 500 response. This annotation should be used on the Exception classes and not on the REST Resource itself.
  • Required Element Summary

    Required Elements 
    Modifier and Type Required Element Description
    java.lang.String errorCode
    errorCode property to be included in the Error Response Body JSON.
    java.lang.String message
    message property to be included in the Error Response Body JSON.
  • Element Details

    • errorCode

      java.lang.String errorCode
      errorCode property to be included in the Error Response Body JSON.
      Required.
    • message

      java.lang.String message
      message property to be included in the Error Response Body JSON.
      Required.