public class ErrorResponse extends Object
QueryException
with the intended going-forward error responses from DruidException
The intent is that eventually QueryException
is completely subsumed by
DruidException
in which case the legacy bits of this class can hopefully also be removed.
The intended long-term schema of output is an object that looks like
{ "errorCode": `a code string`, "persona": USER | ADMIN | OPERATOR | DEVELOPER "category": DEFENSIVE | INVALID_INPUT | UNAUTHORIZED | CAPACITY_EXCEEDED | CANCELED | RUNTIME_FAILURE | TIMEOUT | UNSUPPORTED | UNCATEGORIZED "errorMessage": `a message for the intended audience` "context": `a map of extra context values that might be helpful` }
In the interim, there are extra fields that also end up included so that the wire-schema can also be interpretted and handled by clients that are built assuming they are looking at QueryExceptions. These extra fields are
{ "error": `an error code from QueryException` | "druidException" "errorClass": `the error class, as used by QueryException` "host": `the host that the exception occurred on, as used by QueryException` }
These 3 top-level fields are deprecated and will eventually disappear from API responses. The values can, instead, be pulled from the context object of an "legacyQueryException" errorCode object. The field names in the context object map as follows * "error" -> "legacyErrorCode" * "errorClass" -> "errorClass" * "host" -> "host"
Constructor and Description |
---|
ErrorResponse(DruidException underlyingException) |
Modifier and Type | Method and Description |
---|---|
static ErrorResponse |
fromMap(Map<String,Object> map) |
Map<String,Object> |
getAsMap() |
DruidException |
getUnderlyingException() |
public ErrorResponse(DruidException underlyingException)
public static ErrorResponse fromMap(Map<String,Object> map)
public DruidException getUnderlyingException()
Copyright © 2011–2023 The Apache Software Foundation. All rights reserved.