Class RelationalException

    • 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.
      • getErrorCode

        public ErrorCode getErrorCode()
      • getContext

        public java.util.Map<java.lang.String,​java.lang.Object> getContext()