Class RelationalException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- com.apple.foundationdb.relational.api.exceptions.RelationalException
-
- All Implemented Interfaces:
java.io.Serializable
- Direct Known Subclasses:
InternalErrorException
,InvalidColumnReferenceException
,InvalidTypeException
@API(EXPERIMENTAL) public class RelationalException extends java.lang.Exception
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description RelationalException(ErrorCode errorCode, java.lang.Throwable cause)
RelationalException(java.lang.String message, ErrorCode errorCode)
RelationalException(java.lang.String message, ErrorCode errorCode, java.lang.Throwable cause)
RelationalException(java.lang.String message, java.sql.SQLException sqle)
RelationalException(java.sql.SQLException sqle)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description RelationalException
addContext(java.lang.String ctxName, java.lang.Object ctxValue)
Add additional context to the Exception.java.util.Map<java.lang.String,java.lang.Object>
getContext()
ErrorCode
getErrorCode()
java.sql.SQLException
toSqlException()
UncheckedRelationalException
toUncheckedWrappedException()
RelationalException
withContext(java.util.Map<java.lang.String,java.lang.Object> context)
Add additional context to the Exception.
-
-
-
Constructor Detail
-
RelationalException
public RelationalException(java.lang.String message, ErrorCode errorCode)
-
RelationalException
public RelationalException(java.lang.String message, ErrorCode errorCode, java.lang.Throwable cause)
-
RelationalException
public RelationalException(ErrorCode errorCode, java.lang.Throwable cause)
-
RelationalException
public RelationalException(java.sql.SQLException sqle)
-
RelationalException
public RelationalException(java.lang.String message, java.sql.SQLException sqle)
-
-
Method Detail
-
toSqlException
public java.sql.SQLException toSqlException()
-
addContext
public RelationalException addContext(java.lang.String ctxName, java.lang.Object ctxValue)
Add additional context to the Exception. This method is intended to carry "context" for easy logging purposes, it is not a replacement for proper error codes or for effective error messages. Any information that is held within this context should (within reason) also be contained within either the error message or the ErrorCode fields. This method exists solely for the purposes of carrying a historical error handling logic forward, and should not be relied upon for important information.- Parameters:
ctxName
- the name of the additional context field.ctxValue
- the value of the additional context field.- Returns:
- an exception holding the context.
-
withContext
public RelationalException withContext(@Nonnull java.util.Map<java.lang.String,java.lang.Object> context)
Add additional context to the Exception. This method is intended to carry "context" for easy logging purposes, it is not a replacement for proper error codes or for effective error messages. Any information that is held within this context should (within reason) also be contained within either the error message or the ErrorCode fields. This method exists solely for the purposes of carrying a historical error handling logic forward, and should not be relied upon for important information.- Parameters:
context
- additional context as a map.- Returns:
- an exception holding the context.
-
toUncheckedWrappedException
public UncheckedRelationalException toUncheckedWrappedException()
-
getErrorCode
public ErrorCode getErrorCode()
-
getContext
public java.util.Map<java.lang.String,java.lang.Object> getContext()
-
-