Package org.apache.arrow.adbc.core
Class AdbcException
java.lang.Object
java.lang.Throwable
java.lang.Exception
org.apache.arrow.adbc.core.AdbcException
- All Implemented Interfaces:
Serializable
An error in the database or ADBC driver.
The exception contains up to five types of information about the error:
- An error message
- An exception cause
- An ADBC status code
- A SQLSTATE string
- A vendor-specific status code
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionAdbcException
(@Nullable String message, @Nullable Throwable cause, AdbcStatusCode status, @Nullable String sqlState, int vendorCode) AdbcException
(@Nullable String message, @Nullable Throwable cause, AdbcStatusCode status, @Nullable String sqlState, int vendorCode, Collection<ErrorDetail> details) -
Method Summary
Modifier and TypeMethodDescriptionGet extra driver-specific error details.@Nullable String
A SQLSTATE error code, if provided, as defined by the SQL:2003 standard.The ADBC status code.int
A vendor-specific error code, if applicable.static AdbcException
invalidArgument
(String message) Create a new exception with codeAdbcStatusCode.INVALID_ARGUMENT
.static AdbcException
invalidState
(String message) Create a new exception with codeAdbcStatusCode.INVALID_STATE
.static AdbcException
Create a new exception with codeAdbcStatusCode.IO
.static AdbcException
notImplemented
(String message) Create a new exception with codeAdbcStatusCode.NOT_IMPLEMENTED
.toString()
Copy this exception with a different cause (a convenience for use with the static factories).withDetails
(Collection<ErrorDetail> details) Copy this exception with different details (a convenience for use with the static factories).Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
-
Constructor Details
-
AdbcException
public AdbcException(@Nullable String message, @Nullable Throwable cause, AdbcStatusCode status, @Nullable String sqlState, int vendorCode) -
AdbcException
public AdbcException(@Nullable String message, @Nullable Throwable cause, AdbcStatusCode status, @Nullable String sqlState, int vendorCode, Collection<ErrorDetail> details)
-
-
Method Details
-
invalidArgument
Create a new exception with codeAdbcStatusCode.INVALID_ARGUMENT
. -
io
Create a new exception with codeAdbcStatusCode.IO
. -
invalidState
Create a new exception with codeAdbcStatusCode.INVALID_STATE
. -
notImplemented
Create a new exception with codeAdbcStatusCode.NOT_IMPLEMENTED
. -
getStatus
The ADBC status code. -
getSqlState
A SQLSTATE error code, if provided, as defined by the SQL:2003 standard. -
getVendorCode
public int getVendorCode()A vendor-specific error code, if applicable. -
getDetails
Get extra driver-specific error details.This allows drivers to return custom, structured error information (for example, JSON or Protocol Buffers) that can be optionally parsed by clients, beyond the standard AdbcError fields, without having to encode it in the error message. The encoding of the data is driver-defined.
-
withCause
Copy this exception with a different cause (a convenience for use with the static factories). -
withDetails
Copy this exception with different details (a convenience for use with the static factories). -
toString
-