org.apache.calcite.avatica.remote

## Class AvaticaRuntimeException

- java.lang.Object
- - java.lang.Throwable
  - - java.lang.Exception
    - - java.lang.RuntimeException
      - - org.apache.calcite.avatica.remote.AvaticaRuntimeException

All Implemented Interfaces:
  Serializable

    public class AvaticaRuntimeException
    extends RuntimeException

A `RuntimeException` thrown by Avatica with additional contextual information about what happened to cause the Exception.

See Also:
  Serialized Form

### Field Summary

Fields
`private int` `errorCode`
`private String` `errorMessage`
`private static long` `serialVersionUID`
`private AvaticaSeverity` `severity`
`private String` `sqlState`

### Constructor Summary

Constructors
Constructor and Description
`AvaticaRuntimeException()` Constructs an `AvaticaRuntimeException` with no additional information.
`AvaticaRuntimeException(String errorMessage, int errorCode, String sqlState, AvaticaSeverity severity)` Constructs an `AvaticaRuntimeException` with the given contextual information surrounding the error.

### Method Summary

All Methods Instance Methods Concrete Methods
`int` `getErrorCode()` Returns a numeric code for this error.
`String` `getErrorMessage()` Returns a human-readable error message.
`AvaticaSeverity` `getSeverity()` Returns the severity at which this exception is thrown.
`String` `getSqlState()` Returns the five-character identifier for this error.
`String` `toString()`

### Methods inherited from class java.lang.Throwable

`addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### Field Detail

#### serialVersionUID

    private static final long serialVersionUID

See Also:
  Constant Field Values

#### errorMessage

    private final String errorMessage

#### errorCode

    private final int errorCode

#### sqlState

    private final String sqlState

#### severity

    private final AvaticaSeverity severity

### Constructor Detail

#### AvaticaRuntimeException

    public AvaticaRuntimeException()

Constructs an `AvaticaRuntimeException` with no additional information.

It is strongly preferred that the caller invoke `AvaticaRuntimeException(String, int, String, AvaticaSeverity)` with proper contextual information.

#### AvaticaRuntimeException

    public AvaticaRuntimeException(String errorMessage,
                                   int errorCode,
                                   String sqlState,
                                   AvaticaSeverity severity)

Constructs an `AvaticaRuntimeException` with the given contextual information surrounding the error.

Parameters:
  `errorMessage` - A human-readable explanation about what happened
  `errorCode` - Numeric identifier for error
  `sqlState` - 5-character identifier for error
  `severity` - Severity

### Method Detail

#### getErrorMessage

    public String getErrorMessage()

Returns a human-readable error message.

#### getErrorCode

    public int getErrorCode()

Returns a numeric code for this error.

#### getSqlState

    public String getSqlState()

Returns the five-character identifier for this error.

#### getSeverity

    public AvaticaSeverity getSeverity()

Returns the severity at which this exception is thrown.

#### toString

    public String toString()

Overrides:
  `toString` in class `Throwable`