public class PigException
extends java.io.IOException
PigException
class. Details such as the source of the error, error message, error
code, etc. are contained in this class. The default values for the
attributes are:
errorSource = BUG
errorCode = 0
retriable = false
detailedMessage = null
location = nullModifier and Type | Field and Description |
---|---|
static byte |
BUG |
protected java.lang.String |
detailedMessage |
static byte |
ERROR |
protected int |
errorCode |
protected byte |
errorSource |
static byte |
INPUT |
protected boolean |
markedAsShowToUser |
static byte |
REMOTE_ENVIRONMENT |
protected boolean |
retriable |
protected SourceLocation |
sourceLocation |
static byte |
USER_ENVIRONMENT |
Constructor and Description |
---|
PigException()
Create a new PigException with null as the error message.
|
PigException(java.lang.String message)
Create a new PigException with the specified message.
|
PigException(java.lang.String message,
int errCode)
Create a new PigException with the specified message and cause.
|
PigException(java.lang.String message,
int errCode,
boolean retry)
Create a new PigException with the specified message and cause.
|
PigException(java.lang.String message,
int errCode,
byte errSrc)
Create a new PigException with the specified message and cause.
|
PigException(java.lang.String message,
int errCode,
byte errSrc,
boolean retry)
Create a new PigException with the specified message and cause.
|
PigException(java.lang.String message,
int errCode,
byte errSrc,
boolean retry,
java.lang.String detailedMsg)
Create a new PigException with the specified message and cause.
|
PigException(java.lang.String message,
int errCode,
byte errSrc,
boolean retry,
java.lang.String detailedMsg,
SourceLocation location)
Create a new PigException with the specified message and cause.
|
PigException(java.lang.String message,
int errCode,
byte errSrc,
boolean retry,
java.lang.String detailedMsg,
java.lang.Throwable cause)
Create a new PigException with the specified message, error code, error source, retriable or not, detalied message for the developer and cause.
|
PigException(java.lang.String message,
int errCode,
byte errSrc,
boolean retry,
java.lang.String detailedMsg,
java.lang.Throwable cause,
SourceLocation location)
Create a new PigException with the specified message, error code, error source, retriable or not, detalied message for the developer and cause.
|
PigException(java.lang.String message,
int errCode,
byte errSrc,
SourceLocation location)
Create a new PigException with the specified message and cause.
|
PigException(java.lang.String message,
int errCode,
byte errSrc,
java.lang.Throwable cause)
Create a new PigException with the specified message and cause.
|
PigException(java.lang.String message,
int errCode,
byte errSrc,
java.lang.Throwable cause,
SourceLocation location)
Create a new PigException with the specified message and cause.
|
PigException(java.lang.String message,
int errCode,
SourceLocation location)
Create a new PigException with the specified message and cause.
|
PigException(java.lang.String message,
int errCode,
java.lang.Throwable cause)
Create a new PigException with the specified message and cause.
|
PigException(java.lang.String message,
int errCode,
java.lang.Throwable cause,
SourceLocation location)
Create a new PigException with the specified message and cause.
|
PigException(java.lang.String message,
SourceLocation location)
Create a new PigException with the specified message.
|
PigException(java.lang.String message,
java.lang.Throwable cause)
Create a new PigException with the specified message and cause.
|
PigException(java.lang.Throwable cause)
Create a new PigException with the specified cause.
|
Modifier and Type | Method and Description |
---|---|
static byte |
determineErrorSource(int errCode)
A static method to determine the error source given the error code
|
java.lang.String |
getDetailedMessage()
Returns the detailed message used by developers for debugging
|
int |
getErrorCode()
Returns the error code of the exception
|
byte |
getErrorSource()
Returns the error source of the exception.
|
boolean |
getMarkedAsShowToUser()
Check if this PigException is marked as the ones whose message is to be
displayed to the user.
|
SourceLocation |
getSourceLocation()
Return the location in the source that generated the exception.
|
static boolean |
isBug(byte errSource)
A static method to query if an error source is due to
a bug or not.
|
static boolean |
isInput(byte errSource)
A static method to query if an error source is due to
an input or not.
|
static boolean |
isRemoteEnvironment(byte errSource)
A static method to query if an error source is due to
the remote environment or not.
|
static boolean |
isUserEnvironment(byte errSource)
A static method to query if an error source is due to
the user environment or not.
|
boolean |
retriable()
Checks if the exception is retriable.
|
void |
setDetailedMessage(java.lang.String detailMsg)
Set the detailed message of the exception
|
void |
setErrorCode(int code)
Set the error code of the exception
|
void |
setErrorSource(byte src)
Set the error source of the exception
|
void |
setMarkedAsShowToUser(boolean showToUser)
Mark this exception as a good candidate for showing its message to the
pig user
|
void |
setRetriable(boolean retry)
Set the retriable attribute of the exception
|
void |
setSourceLocation(SourceLocation location) |
java.lang.String |
toString()
Returns a short description of this throwable.
|
public static final byte INPUT
public static final byte BUG
public static final byte USER_ENVIRONMENT
public static final byte REMOTE_ENVIRONMENT
public static final byte ERROR
protected int errorCode
protected byte errorSource
protected boolean retriable
protected java.lang.String detailedMessage
protected boolean markedAsShowToUser
protected SourceLocation sourceLocation
public PigException()
public PigException(java.lang.String message)
message
- - The error message (which is saved for later retrieval by the Throwable.getMessage() method) shown to the userpublic PigException(java.lang.String message, SourceLocation location)
message
- - The error message (which is saved for later retrieval by the Throwable.getMessage() method) shown to the userlocation
- - The SourceLocation that generated this error.public PigException(java.lang.Throwable cause)
cause
- - The cause (which is saved for later retrieval by the Throwable.getCause() method) indicating the source of this exception. A null value is permitted, and indicates that the cause is nonexistent or unknown.public PigException(java.lang.String message, java.lang.Throwable cause)
message
- - The error message (which is saved for later retrieval by the Throwable.getMessage() method) shown to the usercause
- - The cause (which is saved for later retrieval by the Throwable.getCause() method) indicating the source of this exception. A null value is permitted, and indicates that the cause is nonexistent or unknown.public PigException(java.lang.String message, int errCode)
message
- - The error message (which is saved for later retrieval by the Throwable.getMessage() method) shown to the usererrCode
- - The error code shown to the userpublic PigException(java.lang.String message, int errCode, SourceLocation location)
message
- - The error message (which is saved for later retrieval by the Throwable.getMessage() method) shown to the usererrCode
- - The error code shown to the userlocation
- - The SourceLocation that generated this error.public PigException(java.lang.String message, int errCode, java.lang.Throwable cause)
message
- - The error message (which is saved for later retrieval by the Throwable.getMessage() method) shown to the usererrCode
- - The error code shown to the usercause
- - The cause (which is saved for later retrieval by the Throwable.getCause() method) indicating the source of this exception. A null value is permitted, and indicates that the cause is nonexistent or unknown.public PigException(java.lang.String message, int errCode, java.lang.Throwable cause, SourceLocation location)
message
- - The error message (which is saved for later retrieval by the Throwable.getMessage() method) shown to the usererrCode
- - The error code shown to the usercause
- - The cause (which is saved for later retrieval by the Throwable.getCause() method) indicating the source of this exception. A null value is permitted, and indicates that the cause is nonexistent or unknown.location
- - The SourceLocation that generated this error.public PigException(java.lang.String message, int errCode, byte errSrc)
message
- - The error message (which is saved for later retrieval by the Throwable.getMessage() method) shown to the usererrCode
- - The error code shown to the usererrSrc
- - The error sourcepublic PigException(java.lang.String message, int errCode, byte errSrc, SourceLocation location)
message
- - The error message (which is saved for later retrieval by the Throwable.getMessage() method) shown to the usererrCode
- - The error code shown to the usererrSrc
- - The error sourcelocation
- - The SourceLocation that generated this error.public PigException(java.lang.String message, int errCode, byte errSrc, java.lang.Throwable cause)
message
- - The error message (which is saved for later retrieval by the Throwable.getMessage() method) shown to the usererrCode
- - The error code shown to the usererrSrc
- - The error sourcecause
- - The cause (which is saved for later retrieval by the Throwable.getCause() method) indicating the source of this exception. A null value is permitted, and indicates that the cause is nonexistent or unknown.public PigException(java.lang.String message, int errCode, byte errSrc, java.lang.Throwable cause, SourceLocation location)
message
- - The error message (which is saved for later retrieval by the Throwable.getMessage() method) shown to the usererrCode
- - The error code shown to the usererrSrc
- - The error sourcecause
- - The cause (which is saved for later retrieval by the Throwable.getCause() method) indicating the source of this exception. A null value is permitted, and indicates that the cause is nonexistent or unknown.location
- - The SourceLocation that generated this error.public PigException(java.lang.String message, int errCode, boolean retry)
message
- - The error message (which is saved for later retrieval by the Throwable.getMessage() method) shown to the usererrCode
- - The error code shown to the userretry
- - If the exception is retriable or notpublic PigException(java.lang.String message, int errCode, byte errSrc, boolean retry)
message
- - The error message (which is saved for later retrieval by the Throwable.getMessage() method) shown to the usererrCode
- - The error code shown to the usererrSrc
- - The error sourceretry
- - If the exception is retriable or notpublic PigException(java.lang.String message, int errCode, byte errSrc, boolean retry, java.lang.String detailedMsg)
message
- - The error message (which is saved for later retrieval by the Throwable.getMessage() method) shown to the usererrCode
- - The error code shown to the usererrSrc
- - The error sourceretry
- - If the exception is retriable or notdetailedMsg
- - The detailed message shown to the developerpublic PigException(java.lang.String message, int errCode, byte errSrc, boolean retry, java.lang.String detailedMsg, SourceLocation location)
message
- - The error message (which is saved for later retrieval by the Throwable.getMessage() method) shown to the usererrCode
- - The error code shown to the usererrSrc
- - The error sourceretry
- - If the exception is retriable or notdetailedMsg
- - The detailed message shown to the developerpublic PigException(java.lang.String message, int errCode, byte errSrc, boolean retry, java.lang.String detailedMsg, java.lang.Throwable cause)
message
- - The error message (which is saved for later retrieval by the Throwable.getMessage() method) shown to the usererrCode
- - The error code shown to the usererrSrc
- - The error sourceretry
- - If the exception is retriable or notdetailedMsg
- - The detailed message shown to the developercause
- - The cause (which is saved for later retrieval by the Throwable.getCause() method) indicating the source of this exception. A null value is permitted, and indicates that the cause is nonexistent or unknown.public PigException(java.lang.String message, int errCode, byte errSrc, boolean retry, java.lang.String detailedMsg, java.lang.Throwable cause, SourceLocation location)
message
- - The error message (which is saved for later retrieval by the Throwable.getMessage() method) shown to the usererrCode
- - The error code shown to the usererrSrc
- - The error sourceretry
- - If the exception is retriable or notdetailedMsg
- - The detailed message shown to the developercause
- - The cause (which is saved for later retrieval by the Throwable.getCause() method) indicating the source of this exception. A null value is permitted, and indicates that the cause is nonexistent or unknown.location
- - The SourceLocation that generated this error.public static boolean isInput(byte errSource)
errSource
- - byte that indicates the error sourcepublic static boolean isBug(byte errSource)
errSource
- - byte that indicates the error sourcepublic static boolean isUserEnvironment(byte errSource)
errSource
- - byte that indicates the error sourcepublic static boolean isRemoteEnvironment(byte errSource)
errSource
- - byte that indicates the error sourcepublic static byte determineErrorSource(int errCode)
errCode
- - integer error codepublic boolean retriable()
public void setRetriable(boolean retry)
retry
- - true if retriable; false otherwisepublic byte getErrorSource()
public void setErrorSource(byte src)
src
- - byte representing the error sourcespublic int getErrorCode()
public void setErrorCode(int code)
code
- - error codepublic java.lang.String getDetailedMessage()
public void setDetailedMessage(java.lang.String detailMsg)
detailMsg
- - detailed message to be used by developerspublic boolean getMarkedAsShowToUser()
public void setMarkedAsShowToUser(boolean showToUser)
public SourceLocation getSourceLocation()
public void setSourceLocation(SourceLocation location)
public java.lang.String toString()
getErrorCode()
method
getLocalizedMessage
method
toString
in class java.lang.Throwable
Copyright © 2007-2017 The Apache Software Foundation