|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.Throwable
java.lang.Exception
java.io.IOException
org.apache.pig.PigException
public class PigException
All exceptions in Pig are encapsulated in the 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
Field Summary | |
---|---|
static byte |
BUG
|
protected String |
detailedMessage
|
static byte |
ERROR
|
protected int |
errorCode
|
protected byte |
errorSource
|
static byte |
INPUT
|
protected boolean |
markedAsShowToUser
|
static byte |
REMOTE_ENVIRONMENT
|
protected boolean |
retriable
|
static byte |
USER_ENVIRONMENT
|
Constructor Summary | |
---|---|
PigException()
Create a new PigException with null as the error message. |
|
PigException(String message)
Create a new PigException with the specified message. |
|
PigException(String message,
int errCode)
Create a new PigException with the specified message and cause. |
|
PigException(String message,
int errCode,
boolean retry)
Create a new PigException with the specified message and cause. |
|
PigException(String message,
int errCode,
byte errSrc)
Create a new PigException with the specified message and cause. |
|
PigException(String message,
int errCode,
byte errSrc,
boolean retry)
Create a new PigException with the specified message and cause. |
|
PigException(String message,
int errCode,
byte errSrc,
boolean retry,
String detailedMsg)
Create a new PigException with the specified message and cause. |
|
PigException(String message,
int errCode,
byte errSrc,
boolean retry,
String detailedMsg,
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(String message,
int errCode,
byte errSrc,
Throwable cause)
Create a new PigException with the specified message and cause. |
|
PigException(String message,
int errCode,
Throwable cause)
Create a new PigException with the specified message and cause. |
|
PigException(String message,
Throwable cause)
Create a new PigException with the specified message and cause. |
|
PigException(Throwable cause)
Create a new PigException with the specified cause. |
Method Summary | |
---|---|
static byte |
determineErrorSource(int errCode)
A static method to determine the error source given the error code |
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. |
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(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 |
String |
toString()
Returns a short description of this throwable. |
Methods inherited from class java.lang.Throwable |
---|
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
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 String detailedMessage
protected boolean markedAsShowToUser
Constructor Detail |
---|
public PigException()
public PigException(String message)
message
- - The error message (which is saved for later retrieval by the Throwable.getMessage() method) shown to the userpublic PigException(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(String message, 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(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(String message, int errCode, 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(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(String message, int errCode, byte errSrc, 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(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(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(String message, int errCode, byte errSrc, boolean retry, 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(String message, int errCode, byte errSrc, boolean retry, String detailedMsg, 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.Method Detail |
---|
public static boolean isInput(byte errSource)
errSource
- - byte that indicates the error source
public static boolean isBug(byte errSource)
errSource
- - byte that indicates the error source
public static boolean isUserEnvironment(byte errSource)
errSource
- - byte that indicates the error source
public static boolean isRemoteEnvironment(byte errSource)
errSource
- - byte that indicates the error source
public static byte determineErrorSource(int errCode)
errCode
- - integer error code
public 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 String getDetailedMessage()
public void setDetailedMessage(String detailMsg)
detailMsg
- - detailed message to be used by developerspublic boolean getMarkedAsShowToUser()
public void setMarkedAsShowToUser(boolean showToUser)
public String toString()
getErrorCode()
method
getLocalizedMessage
method
toString
in class Throwable
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |