Class ApiException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- cloud.metaapi.sdk.clients.error_handler.ApiException
-
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
ConflictException,ForbiddenException,InternalException,NotFoundException,UnauthorizedException,ValidationException
public class ApiException extends Exception
Base class for API errors. Contains indication of HTTP status.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description intstatusHTTP status code
-
Constructor Summary
Constructors Constructor Description ApiException(String message, int status)ApiError constructorApiException(String message, int status, Throwable cause)ApiError constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<Object>getArguments()Returns message arguments for i18nStringgetCode()Returns error code used for i18nvoidsetArguments(List<Object> args)Set message arguments for i18nvoidsetCode(String code)Sets error code, used for i18n-
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
-
-
-
Constructor Detail
-
ApiException
public ApiException(String message, int status)
ApiError constructor- Parameters:
message- error messagestatus- HTTP status
-
-
Method Detail
-
setCode
public void setCode(String code)
Sets error code, used for i18n- Parameters:
code- error code for i18n
-
getCode
public String getCode()
Returns error code used for i18n- Returns:
- error code
-
setArguments
public void setArguments(List<Object> args)
Set message arguments for i18n- Parameters:
args- arguments for i18n
-
-