public class ApiException extends java.lang.RuntimeException implements Status
| Modifier and Type | Field and Description |
|---|---|
protected java.lang.String |
status |
SC_200_OK, SC_201_CREATED, SC_204_NO_CONTENT, SC_308_PERMANENT_REDIRECT, SC_400_BAD_REQUEST, SC_401_UNAUTHORIZED, SC_403_FORBIDDEN, SC_404_NOT_FOUND, SC_429_TOO_MANY_REQUESTS, SC_500_INTERNAL_SERVER_ERROR, SC_501_NOT_IMPLEMENTED| Constructor and Description |
|---|
ApiException() |
ApiException(java.lang.String httpStatus) |
ApiException(java.lang.String messageFormat,
java.lang.Object... args) |
ApiException(java.lang.String httpStatus,
java.lang.Throwable cause,
java.lang.String messageFormat,
java.lang.Object... args) |
ApiException(java.lang.Throwable cause) |
| Modifier and Type | Method and Description |
|---|---|
static java.lang.String |
getMessage(java.lang.String httpStatus,
java.lang.Throwable cause,
java.lang.String messageFormat,
java.lang.Object... args)
Constructs a useful error message.
|
java.lang.String |
getStatus() |
boolean |
hasStatus(int... statusCodes) |
static ApiException |
new400BadRequest() |
static ApiException |
new400BadRequest(java.lang.String messageFormat,
java.lang.Object... messages) |
static ApiException |
new400BadRequest(java.lang.Throwable cause) |
static ApiException |
new400BadRequest(java.lang.Throwable cause,
java.lang.String messageFormat,
java.lang.Object... messages) |
static ApiException |
new401Unauthroized() |
static ApiException |
new401Unauthroized(java.lang.String messageFormat,
java.lang.Object... messages) |
static ApiException |
new401Unauthroized(java.lang.Throwable cause) |
static ApiException |
new401Unauthroized(java.lang.Throwable cause,
java.lang.String messageFormat,
java.lang.Object... messages) |
static ApiException |
new403Forbidden() |
static ApiException |
new403Forbidden(java.lang.String messageFormat,
java.lang.Object... messages) |
static ApiException |
new403Forbidden(java.lang.Throwable cause) |
static ApiException |
new403Forbidden(java.lang.Throwable cause,
java.lang.String messageFormat,
java.lang.Object... messages) |
static ApiException |
new404NotFound() |
static ApiException |
new404NotFound(java.lang.String messageFormat,
java.lang.Object... messages) |
static ApiException |
new404NotFound(java.lang.Throwable cause) |
static ApiException |
new404NotFound(java.lang.Throwable cause,
java.lang.String messageFormat,
java.lang.Object... messages) |
static ApiException |
new429TooManyRequests() |
static ApiException |
new429TooManyRequests(java.lang.String messageFormat,
java.lang.Object... messages) |
static ApiException |
new429TooManyRequests(java.lang.Throwable cause) |
static ApiException |
new429TooManyRequests(java.lang.Throwable cause,
java.lang.String messageFormat,
java.lang.Object... messages) |
static ApiException |
new500InternalServerError() |
static ApiException |
new500InternalServerError(java.lang.String messageFormat,
java.lang.Object... args) |
static ApiException |
new500InternalServerError(java.lang.Throwable cause) |
static ApiException |
new500InternalServerError(java.lang.Throwable cause,
java.lang.String messageFormat,
java.lang.Object... args) |
static ApiException |
new501NotImplemented() |
static ApiException |
new501NotImplemented(java.lang.String messageFormat,
java.lang.Object... args) |
static ApiException |
new501NotImplemented(java.lang.Throwable cause) |
static ApiException |
new501NotImplemented(java.lang.Throwable cause,
java.lang.String messageFormat,
java.lang.Object... args) |
static void |
throw400BadRequest()
Deprecated.
this pattern was throwing off static code analysis. It is recommended to replace
the usage of this method with "throw ApiException.newXXX(...)
|
static void |
throw400BadRequest(java.lang.String messageFormat,
java.lang.Object... messages)
Deprecated.
this pattern was throwing off static code analysis. It is recommended to replace
the usage of this method with "throw ApiException.newXXX(...)
|
static void |
throw400BadRequest(java.lang.Throwable cause)
Deprecated.
this pattern was throwing off static code analysis. It is recommended to replace
the usage of this method with "throw ApiException.newXXX(...)
|
static void |
throw400BadRequest(java.lang.Throwable cause,
java.lang.String messageFormat,
java.lang.Object... messages)
Deprecated.
this pattern was throwing off static code analysis. It is recommended to replace
the usage of this method with "throw ApiException.newXXX(...)
|
static void |
throw401Unauthroized()
Deprecated.
this pattern was throwing off static code analysis. It is recommended to replace
the usage of this method with "throw ApiException.newXXX(...)
|
static void |
throw401Unauthroized(java.lang.String messageFormat,
java.lang.Object... messages)
Deprecated.
this pattern was throwing off static code analysis. It is recommended to replace
the usage of this method with "throw ApiException.newXXX(...)
|
static void |
throw401Unauthroized(java.lang.Throwable cause)
Deprecated.
this pattern was throwing off static code analysis. It is recommended to replace
the usage of this method with "throw ApiException.newXXX(...)
|
static void |
throw401Unauthroized(java.lang.Throwable cause,
java.lang.String messageFormat,
java.lang.Object... messages)
Deprecated.
this pattern was throwing off static code analysis. It is recommended to replace
the usage of this method with "throw ApiException.newXXX(...)
|
static void |
throw403Forbidden()
Deprecated.
this pattern was throwing off static code analysis. It is recommended to replace
the usage of this method with "throw ApiException.newXXX(...)
|
static void |
throw403Forbidden(java.lang.String messageFormat,
java.lang.Object... messages)
Deprecated.
this pattern was throwing off static code analysis. It is recommended to replace
the usage of this method with "throw ApiException.newXXX(...)
|
static void |
throw403Forbidden(java.lang.Throwable cause)
Deprecated.
this pattern was throwing off static code analysis. It is recommended to replace
the usage of this method with "throw ApiException.newXXX(...)
|
static void |
throw403Forbidden(java.lang.Throwable cause,
java.lang.String messageFormat,
java.lang.Object... messages)
Deprecated.
this pattern was throwing off static code analysis. It is recommended to replace
the usage of this method with "throw ApiException.newXXX(...)
|
static void |
throw404NotFound()
Deprecated.
this pattern was throwing off static code analysis. It is recommended to replace
the usage of this method with "throw ApiException.newXXX(...)
|
static void |
throw404NotFound(java.lang.String messageFormat,
java.lang.Object... messages)
Deprecated.
this pattern was throwing off static code analysis. It is recommended to replace
the usage of this method with "throw ApiException.newXXX(...)
|
static void |
throw404NotFound(java.lang.Throwable cause)
Deprecated.
this pattern was throwing off static code analysis. It is recommended to replace
the usage of this method with "throw ApiException.newXXX(...)
|
static void |
throw404NotFound(java.lang.Throwable cause,
java.lang.String messageFormat,
java.lang.Object... messages)
Deprecated.
this pattern was throwing off static code analysis. It is recommended to replace
the usage of this method with "throw ApiException.newXXX(...)
|
static void |
throw429TooManyRequests()
Deprecated.
this pattern was throwing off static code analysis. It is recommended to replace
the usage of this method with "throw ApiException.newXXX(...)
|
static void |
throw429TooManyRequests(java.lang.String messageFormat,
java.lang.Object... messages)
Deprecated.
this pattern was throwing off static code analysis. It is recommended to replace
the usage of this method with "throw ApiException.newXXX(...)
|
static void |
throw429TooManyRequests(java.lang.Throwable cause)
Deprecated.
this pattern was throwing off static code analysis. It is recommended to replace
the usage of this method with "throw ApiException.newXXX(...)
|
static void |
throw429TooManyRequests(java.lang.Throwable cause,
java.lang.String messageFormat,
java.lang.Object... messages)
Deprecated.
this pattern was throwing off static code analysis. It is recommended to replace
the usage of this method with "throw ApiException.newXXX(...)
|
static void |
throw500InternalServerError()
Deprecated.
this pattern was throwing off static code analysis. It is recommended to replace
the usage of this method with "throw ApiException.newXXX(...)
|
static void |
throw500InternalServerError(java.lang.String messageFormat,
java.lang.Object... args)
Deprecated.
this pattern was throwing off static code analysis. It is recommended to replace
the usage of this method with "throw ApiException.newXXX(...)
|
static void |
throw500InternalServerError(java.lang.Throwable cause)
Deprecated.
this pattern was throwing off static code analysis. It is recommended to replace
the usage of this method with "throw ApiException.newXXX(...)
|
static void |
throw500InternalServerError(java.lang.Throwable cause,
java.lang.String messageFormat,
java.lang.Object... args)
Deprecated.
this pattern was throwing off static code analysis. It is recommended to replace
the usage of this method with "throw ApiException.newXXX(...)
|
static void |
throw501NotImplemented()
Deprecated.
this pattern was throwing off static code analysis. It is recommended to replace
the usage of this method with "throw ApiException.newXXX(...)
|
static void |
throw501NotImplemented(java.lang.String messageFormat,
java.lang.Object... args)
Deprecated.
this pattern was throwing off static code analysis. It is recommended to replace
the usage of this method with "throw ApiException.newXXX(...)
|
static void |
throw501NotImplemented(java.lang.Throwable cause)
Deprecated.
this pattern was throwing off static code analysis. It is recommended to replace
the usage of this method with "throw ApiException.newXXX(...)
|
static void |
throw501NotImplemented(java.lang.Throwable cause,
java.lang.String messageFormat,
java.lang.Object... args)
Deprecated.
this pattern was throwing off static code analysis. It is recommended to replace
the usage of this method with "throw ApiException.newXXX(...)
|
static void |
throwEx(java.lang.String messageFormat,
java.lang.Object... args)
Throws a 500 INTERNAL SERVER ERROR ApiException with the given message
|
static void |
throwEx(java.lang.String status,
java.lang.Throwable cause,
java.lang.String messageFormat,
java.lang.Object... args) |
static void |
throwEx(java.lang.Throwable cause)
Rethrows
cause as a 500 INTERNAL SERVER ERROR ApiException |
ApiException |
withStatus(java.lang.String status) |
public ApiException()
throws ApiException
ApiExceptionpublic ApiException(java.lang.Throwable cause)
throws ApiException
ApiExceptionpublic ApiException(java.lang.String httpStatus)
throws ApiException
ApiExceptionpublic ApiException(java.lang.String messageFormat,
java.lang.Object... args)
throws ApiException
ApiExceptionpublic ApiException(java.lang.String httpStatus,
java.lang.Throwable cause,
java.lang.String messageFormat,
java.lang.Object... args)
throws ApiException
ApiExceptionpublic static java.lang.String getMessage(java.lang.String httpStatus,
java.lang.Throwable cause,
java.lang.String messageFormat,
java.lang.Object... args)
All arguments are optional but if everything is null you will get an empty string.
httpStatus - the HTTP stats codde of the errorcause - the cause of the errormessageFormat - the caller supplied error message with variable placeholdersargs - variables to insert into messageFormatUtils.format(String, Object...)public static void throwEx(java.lang.Throwable cause)
throws ApiException
cause as a 500 INTERNAL SERVER ERROR ApiExceptioncause - the cause of the errorApiException - alwayspublic static void throwEx(java.lang.String messageFormat,
java.lang.Object... args)
throws ApiException
messageFormat - the error message potentially with variablesargs - values substituted into messageFormatApiException - alwayspublic static void throwEx(java.lang.String status,
java.lang.Throwable cause,
java.lang.String messageFormat,
java.lang.Object... args)
throws ApiException
ApiExceptionpublic static ApiException new400BadRequest() throws ApiException
ApiExceptionpublic static ApiException new400BadRequest(java.lang.Throwable cause) throws ApiException
ApiExceptionpublic static ApiException new400BadRequest(java.lang.String messageFormat, java.lang.Object... messages) throws ApiException
ApiExceptionpublic static ApiException new400BadRequest(java.lang.Throwable cause, java.lang.String messageFormat, java.lang.Object... messages) throws ApiException
ApiExceptionpublic static ApiException new401Unauthroized() throws ApiException
ApiExceptionpublic static ApiException new401Unauthroized(java.lang.Throwable cause) throws ApiException
ApiExceptionpublic static ApiException new401Unauthroized(java.lang.String messageFormat, java.lang.Object... messages) throws ApiException
ApiExceptionpublic static ApiException new401Unauthroized(java.lang.Throwable cause, java.lang.String messageFormat, java.lang.Object... messages) throws ApiException
ApiExceptionpublic static ApiException new403Forbidden() throws ApiException
ApiExceptionpublic static ApiException new403Forbidden(java.lang.Throwable cause) throws ApiException
ApiExceptionpublic static ApiException new403Forbidden(java.lang.String messageFormat, java.lang.Object... messages) throws ApiException
ApiExceptionpublic static ApiException new403Forbidden(java.lang.Throwable cause, java.lang.String messageFormat, java.lang.Object... messages) throws ApiException
ApiExceptionpublic static ApiException new404NotFound() throws ApiException
ApiExceptionpublic static ApiException new404NotFound(java.lang.Throwable cause) throws ApiException
ApiExceptionpublic static ApiException new404NotFound(java.lang.String messageFormat, java.lang.Object... messages) throws ApiException
ApiExceptionpublic static ApiException new404NotFound(java.lang.Throwable cause, java.lang.String messageFormat, java.lang.Object... messages) throws ApiException
ApiExceptionpublic static ApiException new429TooManyRequests() throws ApiException
ApiExceptionpublic static ApiException new429TooManyRequests(java.lang.Throwable cause) throws ApiException
ApiExceptionpublic static ApiException new429TooManyRequests(java.lang.String messageFormat, java.lang.Object... messages) throws ApiException
ApiExceptionpublic static ApiException new429TooManyRequests(java.lang.Throwable cause, java.lang.String messageFormat, java.lang.Object... messages) throws ApiException
ApiExceptionpublic static ApiException new500InternalServerError() throws ApiException
ApiExceptionpublic static ApiException new500InternalServerError(java.lang.Throwable cause) throws ApiException
ApiExceptionpublic static ApiException new500InternalServerError(java.lang.String messageFormat, java.lang.Object... args) throws ApiException
ApiExceptionpublic static ApiException new500InternalServerError(java.lang.Throwable cause, java.lang.String messageFormat, java.lang.Object... args) throws ApiException
ApiExceptionpublic static ApiException new501NotImplemented() throws ApiException
ApiExceptionpublic static ApiException new501NotImplemented(java.lang.Throwable cause) throws ApiException
ApiExceptionpublic static ApiException new501NotImplemented(java.lang.String messageFormat, java.lang.Object... args) throws ApiException
ApiExceptionpublic static ApiException new501NotImplemented(java.lang.Throwable cause, java.lang.String messageFormat, java.lang.Object... args) throws ApiException
ApiExceptionpublic java.lang.String getStatus()
public ApiException withStatus(java.lang.String status)
public boolean hasStatus(int... statusCodes)
@Deprecated
public static void throw400BadRequest()
throws ApiException
ApiException@Deprecated
public static void throw400BadRequest(java.lang.Throwable cause)
throws ApiException
ApiException@Deprecated
public static void throw400BadRequest(java.lang.String messageFormat,
java.lang.Object... messages)
throws ApiException
ApiException@Deprecated
public static void throw400BadRequest(java.lang.Throwable cause,
java.lang.String messageFormat,
java.lang.Object... messages)
throws ApiException
ApiException@Deprecated
public static void throw401Unauthroized()
throws ApiException
ApiException@Deprecated
public static void throw401Unauthroized(java.lang.Throwable cause)
throws ApiException
ApiException@Deprecated
public static void throw401Unauthroized(java.lang.String messageFormat,
java.lang.Object... messages)
throws ApiException
ApiException@Deprecated
public static void throw401Unauthroized(java.lang.Throwable cause,
java.lang.String messageFormat,
java.lang.Object... messages)
throws ApiException
ApiException@Deprecated
public static void throw403Forbidden()
throws ApiException
ApiException@Deprecated
public static void throw403Forbidden(java.lang.Throwable cause)
throws ApiException
ApiException@Deprecated
public static void throw403Forbidden(java.lang.String messageFormat,
java.lang.Object... messages)
throws ApiException
ApiException@Deprecated
public static void throw403Forbidden(java.lang.Throwable cause,
java.lang.String messageFormat,
java.lang.Object... messages)
throws ApiException
ApiException@Deprecated
public static void throw404NotFound()
throws ApiException
ApiException@Deprecated
public static void throw404NotFound(java.lang.Throwable cause)
throws ApiException
ApiException@Deprecated
public static void throw404NotFound(java.lang.String messageFormat,
java.lang.Object... messages)
throws ApiException
ApiException@Deprecated
public static void throw404NotFound(java.lang.Throwable cause,
java.lang.String messageFormat,
java.lang.Object... messages)
throws ApiException
ApiException@Deprecated
public static void throw429TooManyRequests()
throws ApiException
ApiException@Deprecated
public static void throw429TooManyRequests(java.lang.Throwable cause)
throws ApiException
ApiException@Deprecated
public static void throw429TooManyRequests(java.lang.String messageFormat,
java.lang.Object... messages)
throws ApiException
ApiException@Deprecated
public static void throw429TooManyRequests(java.lang.Throwable cause,
java.lang.String messageFormat,
java.lang.Object... messages)
throws ApiException
ApiException@Deprecated
public static void throw500InternalServerError()
throws ApiException
ApiException@Deprecated
public static void throw500InternalServerError(java.lang.Throwable cause)
throws ApiException
ApiException@Deprecated
public static void throw500InternalServerError(java.lang.String messageFormat,
java.lang.Object... args)
throws ApiException
ApiException@Deprecated
public static void throw500InternalServerError(java.lang.Throwable cause,
java.lang.String messageFormat,
java.lang.Object... args)
throws ApiException
ApiException@Deprecated
public static void throw501NotImplemented()
throws ApiException
ApiException@Deprecated
public static void throw501NotImplemented(java.lang.Throwable cause)
throws ApiException
ApiException@Deprecated
public static void throw501NotImplemented(java.lang.String messageFormat,
java.lang.Object... args)
throws ApiException
ApiException@Deprecated
public static void throw501NotImplemented(java.lang.Throwable cause,
java.lang.String messageFormat,
java.lang.Object... args)
throws ApiException
ApiExceptionCopyright © 2021 Rocket Partners, LLC. All rights reserved.