Annotation Type UnexpectedResponseExceptionType


  • @Retention(RUNTIME)
    @Target(METHOD)
    @Repeatable(UnexpectedResponseExceptionTypes.class)
    public @interface UnexpectedResponseExceptionType
    The exception type that is thrown or returned when one of the status codes is returned from a REST API. Multiple annotations can be used. When no codes are listed that exception is always thrown or returned if it is reached during evaluation, this should be treated as a default case. If no default case is annotated the fall through exception is HttpResponseException. If multiple annotations share the same HTTP status code or there is multiple default annotations the exception from the last annotation in the top to bottom order will be used.
    • Required Element Summary

      Required Elements 
      Modifier and Type Required Element Description
      java.lang.Class<? extends com.azure.android.core.http.exception.HttpResponseException> value
      The type of HttpResponseException that should be thrown/returned when the API returns an unrecognized status code.
    • Optional Element Summary

      Optional Elements 
      Modifier and Type Optional Element Description
      int[] code
      HTTP status codes which trigger the exception to be thrown or returned, if not status codes are listed the exception is always thrown or returned.
    • Element Detail

      • value

        java.lang.Class<? extends com.azure.android.core.http.exception.HttpResponseException> value
        The type of HttpResponseException that should be thrown/returned when the API returns an unrecognized status code.
        Returns:
        The type of RestException that should be thrown/returned.
      • code

        int[] code
        HTTP status codes which trigger the exception to be thrown or returned, if not status codes are listed the exception is always thrown or returned.
        Returns:
        The HTTP status codes that trigger the exception to be thrown or returned.
        Default:
        {}