Package com.yahoo.messagebus
Class Error
java.lang.Object
com.yahoo.messagebus.Error
This class implements the pair (code, message) that is used in Reply to hold errors.
- Author:
- Simon Thoresen Hult
-
Constructor Summary
ConstructorDescriptionThis is the constructor used by anyone adding an error to a message.This constructor is used by the network layer to properly tag deserialized errors with the hostname of whatever service produced the error. -
Method Summary
-
Constructor Details
-
Error
This is the constructor used by anyone adding an error to a message. One does not manually need to set the service name of an error, so ignore the other constructor when creating your own error instance.- Parameters:
code
- The numerical code of this error.message
- The description of this error.
-
Error
This constructor is used by the network layer to properly tag deserialized errors with the hostname of whatever service produced the error. This constructor should NOT be used when manually creating errors.- Parameters:
code
- The numerical code of this error.message
- The description of this error.service
- The service name of this error.
-
-
Method Details
-
getCode
public int getCode()Return the numerical code of this error.- Returns:
- The numerical code.
-
getMessage
Return the description of this error.- Returns:
- The description.
-
getService
Returns the name of the service on which this error occured.- Returns:
- The service name.
-
isFatal
public boolean isFatal()Returns whether or not this error is fatal, i.e. getCode() >= ErrorCode.FATAL_ERROR.- Returns:
- True, if this error is fatal.
-
toString
-