public class ErrorResult extends Result
Base class for Error results, i.e result with status code between 400 and 600 (excluded)
Result.Payload| Constructor and Description |
|---|
ErrorResult(org.osgl.http.H.Status status) |
ErrorResult(org.osgl.http.H.Status status,
Integer errorCode) |
ErrorResult(org.osgl.http.H.Status status,
Integer errorCode,
String message) |
ErrorResult(org.osgl.http.H.Status status,
Integer errorCode,
String message,
Object... args) |
ErrorResult(org.osgl.http.H.Status status,
Integer errorCode,
Throwable cause) |
ErrorResult(org.osgl.http.H.Status status,
Integer errorCode,
Throwable cause,
String message,
Object... args) |
ErrorResult(org.osgl.http.H.Status status,
String message) |
ErrorResult(org.osgl.http.H.Status status,
String message,
Object... args) |
ErrorResult(org.osgl.http.H.Status status,
Throwable cause) |
ErrorResult(org.osgl.http.H.Status status,
Throwable cause,
String message,
Object... args) |
| Modifier and Type | Method and Description |
|---|---|
protected static boolean |
_localizedErrorMsg() |
protected void |
applyMessage(org.osgl.http.H.Request request,
org.osgl.http.H.Response response) |
ErrorResult |
attach(Object attachment) |
<T> T |
attachment() |
<T> T |
attachment(Class<T> type) |
protected static String |
defaultMessage(org.osgl.http.H.Status status) |
Integer |
errorCode() |
ErrorResult |
errorCode(int errorCode) |
String |
getLocalizedMessage() |
static ErrorResult |
of(org.osgl.http.H.Status status) |
static ErrorResult |
of(org.osgl.http.H.Status status,
int errorCode) |
static ErrorResult |
of(org.osgl.http.H.Status status,
int errorCode,
String message,
Object... args) |
static ErrorResult |
of(org.osgl.http.H.Status status,
int errorCode,
Throwable cause) |
static ErrorResult |
of(org.osgl.http.H.Status status,
int errorCode,
Throwable cause,
String message,
Object... args) |
static ErrorResult |
of(org.osgl.http.H.Status status,
String message,
Object... args) |
static ErrorResult |
of(org.osgl.http.H.Status status,
Throwable cause,
String message,
Object... args) |
String |
toJsonString() |
org.osgl.util.KVStore |
toKVStore()
Export the error result data into a
KVStore |
String |
toString() |
addCookie, addHeader, apply, applyAfterCommitHandler, applyBeforeCommitHandler, applyCookies, applyHeaders, applyStatus, clearThreadLocals, header, payload, status, status, statusCode, timestamp, touchPayloaddoFillInStackTrace, fillInStackTraceaddSuppressed, getCause, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTracepublic ErrorResult(org.osgl.http.H.Status status)
public ErrorResult(org.osgl.http.H.Status status,
String message)
public ErrorResult(org.osgl.http.H.Status status,
Throwable cause)
public ErrorResult(org.osgl.http.H.Status status,
Throwable cause,
String message,
Object... args)
public ErrorResult(org.osgl.http.H.Status status,
Integer errorCode)
public ErrorResult(org.osgl.http.H.Status status,
Integer errorCode,
String message,
Object... args)
public ErrorResult attach(Object attachment)
public <T> T attachment()
public <T> T attachment(Class<T> type)
public String toJsonString()
public org.osgl.util.KVStore toKVStore()
Export the error result data into a KVStore
KV store of this error resultpublic ErrorResult errorCode(int errorCode)
public Integer errorCode()
public String getLocalizedMessage()
getLocalizedMessage in class Throwableprotected void applyMessage(org.osgl.http.H.Request request,
org.osgl.http.H.Response response)
applyMessage in class Resultprotected static String defaultMessage(org.osgl.http.H.Status status)
protected static boolean _localizedErrorMsg()
public static ErrorResult of(org.osgl.http.H.Status status)
public static ErrorResult of(org.osgl.http.H.Status status, String message, Object... args)
public static ErrorResult of(org.osgl.http.H.Status status, int errorCode)
public static ErrorResult of(org.osgl.http.H.Status status, int errorCode, String message, Object... args)
public static ErrorResult of(org.osgl.http.H.Status status, int errorCode, Throwable cause)
public static ErrorResult of(org.osgl.http.H.Status status, int errorCode, Throwable cause, String message, Object... args)
public static ErrorResult of(org.osgl.http.H.Status status, Throwable cause, String message, Object... args)
Copyright © 2014–2018 OSGL (Open Source General Library). All rights reserved.