ExceptionType - Represents error response from the server.public final class ErrorCase<ExceptionType extends CoreApiException> extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
DEFAULT
A key for the default errors.
|
| Modifier and Type | Method and Description |
|---|---|
static <ExceptionType extends CoreApiException> |
setReason(String reason,
io.apimatic.coreinterfaces.type.functional.ExceptionCreator<ExceptionType> exceptionCreator)
Create the errorcase using the error reason and exception creator functional interface which
throws the respective exception while throwing.
|
static <ExceptionType extends CoreApiException> |
setTemplate(String reason,
io.apimatic.coreinterfaces.type.functional.ExceptionCreator<ExceptionType> exceptionCreator)
Create the errorcase using the error reason and exception creator functional interface which
throws the respective exception while throwing.
|
void |
throwException(io.apimatic.coreinterfaces.http.Context httpContext)
this method throw the configured exception using functional interface.
|
public static final String DEFAULT
public void throwException(io.apimatic.coreinterfaces.http.Context httpContext)
throws ExceptionType extends CoreApiException
httpContext - is wrapped the request sent to the server and the response received from
the server.ExceptionType - Represents error response from the server.ExceptionType extends CoreApiExceptionpublic static <ExceptionType extends CoreApiException> ErrorCase<ExceptionType> setReason(String reason, io.apimatic.coreinterfaces.type.functional.ExceptionCreator<ExceptionType> exceptionCreator)
ExceptionType - Represents error response from the server.reason - the exception message.exceptionCreator - the functional interface which is responsible to create the server
thrown exception.ErrorCase.public static <ExceptionType extends CoreApiException> ErrorCase<ExceptionType> setTemplate(String reason, io.apimatic.coreinterfaces.type.functional.ExceptionCreator<ExceptionType> exceptionCreator)
ExceptionType - Represents error response from the server.reason - the exception message.exceptionCreator - the functional interface which is responsible to create the server
thrown exception.ErrorCase.Copyright © 2025. All rights reserved.