Package com.yahoo.search.result
Class ErrorMessage
java.lang.Object
com.yahoo.processing.request.ErrorMessage
com.yahoo.search.result.ErrorMessage
- All Implemented Interfaces:
Cloneable
public class ErrorMessage
extends com.yahoo.processing.request.ErrorMessage
An error message with a code. Use create methods to create messages.
The identity of an error message is determined by its values.
- Author:
- bratseth
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final int -
Constructor Summary
ConstructorsConstructorDescriptionErrorMessage(int code, String message) ErrorMessage(int code, String message, String detailedMessage) Creates an application specific error message with an application specific code.ErrorMessage(int code, String message, String detailedMessage, Throwable cause) Creates an application specific error message with an application specific code and a stack trace. -
Method Summary
Modifier and TypeMethodDescriptionclone()static ErrorMessagecreateBackendCommunicationError(String detailedMessage) Creates an error indicating that there was a general error communicating with a backend service.static ErrorMessagecreateBadRequest(String detailedMessage) Creates an error analog to HTTP bad request.static ErrorMessagecreateDocsumReplyError(String detailedMessage) Wraps an error message received in a DocsumReply packetstatic ErrorMessagecreateEmptyDocsums(String detailedMessage) Creates an error indicating that a request to a backend returned empty document content data.static ErrorMessagecreateErrorInPluginSearcher(String detailedMessage) Creates a general error from an application components.static ErrorMessagecreateErrorInPluginSearcher(String detailedMessage, Throwable cause) Creates a general error from an application component.static ErrorMessagecreateForbidden(String detailedMessage) Creates an error indicating that a forbidden operation was requested.static ErrorMessagecreateIllegalQuery(String detailedMessage) Creates an error message indicating that an illegal query was attempted evaluated.static ErrorMessagecreateInternalServerError(String detailedMessage) Creates an error analog to HTTP internal server error.static ErrorMessagecreateInternalServerError(String detailedMessage, Throwable cause) Creates an error analog to HTTP internal server error.static ErrorMessagecreateInvalidQueryParameter(String detailedMessage) Creates an error message indicating that an invalid request parameter was received.static ErrorMessagecreateInvalidQueryParameter(String detailedMessage, Throwable cause) Creates an error message indicating that an invalid request parameter was received.static ErrorMessagecreateInvalidQueryTransformation(String detailedMessage) Creates an error indicating that an invalid query transformation was attempted.static ErrorMessagecreateNoAnswerWhenPingingNode(String detailedMessage) Creates an error indicating that a node could not be pinged.static ErrorMessagecreateNoBackendsInService(String detailedMessage) Creates an error message indicating that some backend service is unreachablestatic ErrorMessagecreateNotFound(String detailedMessage) Creates an error indicating that the requested resource was not found.static ErrorMessagecreateNullQuery(String detailedMessage) Creates an error message indicating that a null query was attempted evaluatedstatic ErrorMessagecreateRequestTooLarge(String detailedMessage) Creates an error message indicating that the request is too largestatic ErrorMessagecreateSearchReplyError(String detailedMessage) Wraps an error message received in a SearchReply packetstatic ErrorMessagecreateServerIsMisconfigured(String detailedMessage) Creates an error indicating that the server is misconfiguredstatic ErrorMessagecreateTimeout(String detailedMessage) Creates an error indicating that a request to a backend timed out.static ErrorMessagecreateUnauthorized(String detailedMessage) Creates an error indicating that the requestor is not authorized to perform the requested operation.static ErrorMessagecreateUnspecifiedError(String detailedMessage) Creates a generic message used when there is no information available on the category of the error.static ErrorMessagecreateUnspecifiedError(String detailedMessage, Throwable cause) Creates a generic message used when there is no information available on the category of the error.booleanstatic ErrorMessagefrom(com.yahoo.processing.request.ErrorMessage error) Returns the given error message as this type.Returns the source producing this error, or null if no source is specifiedinthashCode()voidSets the source producing this errortoString()Methods inherited from class com.yahoo.processing.request.ErrorMessage
getCause, getCode, getDetailedMessage, getMessage
-
Field Details
-
NULL_QUERY
public static final int NULL_QUERY -
timeoutCode
public static final int timeoutCode -
emptyDocsumsCode
public static final int emptyDocsumsCode
-
-
Constructor Details
-
ErrorMessage
-
ErrorMessage
Creates an application specific error message with an application specific code. If the error results from an exception a message which includes information from all nested (cause) exceptions can be generated using com.yahoo.protect.Exceptions.toMessageString(exception). -
ErrorMessage
Creates an application specific error message with an application specific code and a stack trace. This should only be used when there is useful information in the cause, i.e when the exception is not expected. Applications rarely need to handle unexpected exceptions as this is done by the framework.
-
-
Method Details
-
createNoBackendsInService
Creates an error message indicating that some backend service is unreachable -
createNullQuery
Creates an error message indicating that a null query was attempted evaluated -
createRequestTooLarge
Creates an error message indicating that the request is too large -
createIllegalQuery
Creates an error message indicating that an illegal query was attempted evaluated. -
createInvalidQueryParameter
Creates an error message indicating that an invalid request parameter was received. -
createInvalidQueryParameter
Creates an error message indicating that an invalid request parameter was received. -
createUnspecifiedError
Creates a generic message used when there is no information available on the category of the error. -
createUnspecifiedError
Creates a generic message used when there is no information available on the category of the error. -
createErrorInPluginSearcher
Creates a general error from an application components. -
createErrorInPluginSearcher
Creates a general error from an application component. -
createInvalidQueryTransformation
Creates an error indicating that an invalid query transformation was attempted. -
createServerIsMisconfigured
Creates an error indicating that the server is misconfigured -
createBackendCommunicationError
Creates an error indicating that there was a general error communicating with a backend service. -
createNoAnswerWhenPingingNode
Creates an error indicating that a node could not be pinged. -
createTimeout
Creates an error indicating that a request to a backend timed out. -
createEmptyDocsums
Creates an error indicating that a request to a backend returned empty document content data. -
createUnauthorized
Creates an error indicating that the requestor is not authorized to perform the requested operation. If this error is present, a HTTP layer will return 401. -
createForbidden
Creates an error indicating that a forbidden operation was requested. If this error is present, a HTTP layer will return 403. -
createNotFound
Creates an error indicating that the requested resource was not found. If this error is present, a HTTP layer will return 404. -
createBadRequest
Creates an error analog to HTTP bad request. If this error is present, a HTTP layer will return 400. -
createInternalServerError
Creates an error analog to HTTP internal server error. If this error is present, a HTTP layer will return 500. -
createInternalServerError
Creates an error analog to HTTP internal server error. If this error is present, a HTTP layer will return 500. -
createSearchReplyError
Wraps an error message received in a SearchReply packet -
createDocsumReplyError
Wraps an error message received in a DocsumReply packet -
setSource
Sets the source producing this error -
getSource
Returns the source producing this error, or null if no source is specified -
hashCode
public int hashCode()- Overrides:
hashCodein classcom.yahoo.processing.request.ErrorMessage
-
equals
- Overrides:
equalsin classcom.yahoo.processing.request.ErrorMessage
-
toString
- Overrides:
toStringin classcom.yahoo.processing.request.ErrorMessage
-
clone
- Overrides:
clonein classcom.yahoo.processing.request.ErrorMessage
-
from
Returns the given error message as this type. If it already is, this is a cast of the given instance. Otherwise this creates a new instance having the same payload as the given instance.
-