Package org.apache.calcite.avatica

# Class AvaticaSqlException

java.lang.Object
java.lang.Throwable
java.lang.Exception
java.sql.SQLException
org.apache.calcite.avatica.AvaticaSqlException

All Implemented Interfaces:
  `Serializable`, `Iterable<Throwable>`

public class AvaticaSqlException extends SQLException
A client-facing `SQLException` which encapsulates errors from the remote Avatica server.

See Also:
  - Serialized Form

## Constructor Summary

Constructors
Constructor
Description
`AvaticaSqlException(String errorMessage, String sqlState, int errorCode, List<String> stackTraces, String remoteServer)`
Construct the Exception with information from the server.

## Method Summary

Modifier and Type
Method
Description
`String`
`getErrorMessage()`
`String`
`getRemoteServer()`
`List<String>`
`getStackTraces()`
`void`
`printStackTrace(PrintStream stream)`
`void`
`printStackTrace(PrintWriter writer)`

### Methods inherited from class java.sql.SQLException

`getErrorCode, getNextException, getSQLState, iterator, setNextException`

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

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

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

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

### Methods inherited from interface java.lang.Iterable

`forEach, spliterator`

## Constructor Details

### AvaticaSqlException

public AvaticaSqlException(String errorMessage, String sqlState, int errorCode, List<String> stackTraces, String remoteServer)
Construct the Exception with information from the server.

Parameters:
  `errorMessage` - A human-readable error message.
  `errorCode` - An integer corresponding to a known error.
  `stackTraces` - Server-side stacktrace.
  `remoteServer` - The host:port where the Avatica server is located

## Method Details

### getErrorMessage

public String getErrorMessage()

### getStackTraces

public List<String> getStackTraces()

Returns:
  The stacktraces for exceptions thrown on the Avatica server.

### getRemoteServer

public String getRemoteServer()

Returns:
  The host:port for the remote Avatica server. May be null.

### printStackTrace

public void printStackTrace(PrintStream stream)

Overrides:
  `printStackTrace` in class `Throwable`

### printStackTrace

public void printStackTrace(PrintWriter writer)

Overrides:
  `printStackTrace` in class `Throwable`