net.snowflake.client.jdbc

## Class SnowflakeSQLLoggedException

- java.lang.Object
- - java.lang.Throwable
  - - java.lang.Exception
    - - java.sql.SQLException
      - - net.snowflake.client.jdbc.SnowflakeSQLException
        - - net.snowflake.client.jdbc.SnowflakeSQLLoggedException

All Implemented Interfaces:
  Serializable, Iterable<Throwable>

    public class SnowflakeSQLLoggedException
    extends SnowflakeSQLException

Author:
  mknister

  This SnowflakeSQLLoggedException class extends the SnowflakeSQLException class to add OOB telemetry data for sql exceptions. Not all sql exceptions require OOB telemetry logging so the exceptions in this class should only be thrown if there is a need for logging the exception with OOB telemetry.

See Also:
  Serialized Form

### Constructor Summary

Constructors
Constructor and Description
`SnowflakeSQLLoggedException(ErrorCode errorCode, SFSession session, Object... params)`
`SnowflakeSQLLoggedException(SFException e, SFSession session)`
`SnowflakeSQLLoggedException(String SQLState, int vendorCode, SFSession session)`
`SnowflakeSQLLoggedException(String SQLState, int vendorCode, SFSession session, Object... params)`
`SnowflakeSQLLoggedException(String reason, SFSession session)`
`SnowflakeSQLLoggedException(String reason, String SQLState, SFSession session)`
`SnowflakeSQLLoggedException(String queryId, String reason, String SQLState, int vendorCode, SFSession session)`
`SnowflakeSQLLoggedException(Throwable ex, ErrorCode errorCode, SFSession session, Object... params)`
`SnowflakeSQLLoggedException(Throwable ex, String SQLState, int vendorCode, SFSession session, Object... params)`

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `sendTelemetryData(String queryId, String reason, String SQLState, int vendorCode, ErrorCode errorCode, SFSession session)` Function to construct log data based on possible exception inputs and send data through in-band telemetry, or oob if in-band does not work

### Methods inherited from class net.snowflake.client.jdbc.SnowflakeSQLException

`getQueryId`

### 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, printStackTrace, 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 Detail

#### SnowflakeSQLLoggedException

    public SnowflakeSQLLoggedException(String queryId,
                                       String reason,
                                       String SQLState,
                                       int vendorCode,
                                       SFSession session)

#### SnowflakeSQLLoggedException

    public SnowflakeSQLLoggedException(String SQLState,
                                       int vendorCode,
                                       SFSession session)

#### SnowflakeSQLLoggedException

    public SnowflakeSQLLoggedException(String reason,
                                       String SQLState,
                                       SFSession session)

#### SnowflakeSQLLoggedException

    public SnowflakeSQLLoggedException(String SQLState,
                                       int vendorCode,
                                       SFSession session,
                                       Object... params)

#### SnowflakeSQLLoggedException

    public SnowflakeSQLLoggedException(Throwable ex,
                                       ErrorCode errorCode,
                                       SFSession session,
                                       Object... params)

#### SnowflakeSQLLoggedException

    public SnowflakeSQLLoggedException(Throwable ex,
                                       String SQLState,
                                       int vendorCode,
                                       SFSession session,
                                       Object... params)

#### SnowflakeSQLLoggedException

    public SnowflakeSQLLoggedException(ErrorCode errorCode,
                                       SFSession session,
                                       Object... params)

#### SnowflakeSQLLoggedException

    public SnowflakeSQLLoggedException(SFException e,
                                       SFSession session)

#### SnowflakeSQLLoggedException

    public SnowflakeSQLLoggedException(String reason,
                                       SFSession session)

### Method Detail

#### sendTelemetryData

    public void sendTelemetryData(String queryId,
                                  String reason,
                                  String SQLState,
                                  int vendorCode,
                                  ErrorCode errorCode,
                                  SFSession session)

Function to construct log data based on possible exception inputs and send data through in-band telemetry, or oob if in-band does not work

Parameters:
  `queryId` - query ID if exists
  `reason` - reason for the exception
  `SQLState` - SQLState
  `vendorCode` - vendor code
  `errorCode` - error code
  `session` - session object, which is needed to send in-band telemetry but not oob. Might be null, in which case oob is used.