Package com.simplicite.util.exceptions
Class HTTPException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- com.simplicite.util.exceptions.PlatformException
-
- com.simplicite.util.exceptions.HTTPException
-
- All Implemented Interfaces:
java.io.Serializable
public class HTTPException extends PlatformException
HTTP call Exception- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class com.simplicite.util.exceptions.PlatformException
UNEXPECTED_ERROR
-
-
Constructor Summary
Constructors Constructor Description HTTPException(int status, java.lang.String message)
ConstructorHTTPException(int status, java.lang.Throwable e)
ConstructorHTTPException(java.lang.String message)
ConstructorHTTPException(java.lang.Throwable e)
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getStatus()
Get HTTP statusboolean
isBadRequest()
Is bas request (400) error?boolean
isForbidden()
Is forbidden (403) error?boolean
isInternalServerError()
Is internal server error (500) error?boolean
isNotFound()
Is not found (404) error?boolean
isUnauthorized()
Is unauthorized (401) error?-
Methods inherited from class com.simplicite.util.exceptions.PlatformException
getFullMessage, getMessage, getMessage, getMessages, getMessages
-
-
-
-
Constructor Detail
-
HTTPException
public HTTPException(java.lang.String message)
Constructor- Parameters:
message
- Message
-
HTTPException
public HTTPException(java.lang.Throwable e)
Constructor- Parameters:
e
- Throwable
-
HTTPException
public HTTPException(int status, java.lang.String message)
Constructor- Parameters:
status
- HTTP status (one of HttpServletResponse.*)message
- String message
-
HTTPException
public HTTPException(int status, java.lang.Throwable e)
Constructor- Parameters:
status
- HTTP status (one of HttpServletResponse.*)e
- Throwable
-
-
Method Detail
-
getStatus
public int getStatus()
Get HTTP status- Returns:
- HTTP status
-
isBadRequest
public boolean isBadRequest()
Is bas request (400) error?- Returns:
- True if bad request
-
isUnauthorized
public boolean isUnauthorized()
Is unauthorized (401) error?- Returns:
- True if unauthorized
-
isForbidden
public boolean isForbidden()
Is forbidden (403) error?- Returns:
- True if forbidden
-
isNotFound
public boolean isNotFound()
Is not found (404) error?- Returns:
- True if not found
-
isInternalServerError
public boolean isInternalServerError()
Is internal server error (500) error?- Returns:
- true if internal server error
-
-