Package 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

## Constructor Summary

Constructors
Constructor
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

Modifier and Type
Method
Description
`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`

## Constructor Details

### 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 Details

### 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`