Class RelationalException

java.lang.Object
java.lang.Throwable
java.lang.Exception
com.apple.foundationdb.relational.api.exceptions.RelationalException
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
InternalErrorException, InvalidColumnReferenceException, InvalidTypeException

@API(EXPERIMENTAL) public class RelationalException extends Exception
See Also:
  • Constructor Details

  • Method Details

    • toSqlException

      public SQLException toSqlException()
    • addContext

      public RelationalException addContext(String ctxName, 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 Map<String,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 Map<String,Object> getContext()