Package 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
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
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
sendTelemetryData(String queryId, String SQLState, int vendorCode, SFBaseSession session, SQLException ex)
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
getElapsedSeconds, getQueryId, getRetryCount, issocketTimeoutNoBackoff
-
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, SFSession session, String sqlState, String message, Exception cause)
-
SnowflakeSQLLoggedException
public SnowflakeSQLLoggedException(SFBaseSession session, String reason, String SQLState, int vendorCode, String queryId)
- Parameters:
session
- SFBaseSessionreason
- exception reasonSQLState
- the SQL statevendorCode
- the vendor codequeryId
- the query ID
-
SnowflakeSQLLoggedException
public SnowflakeSQLLoggedException(SFBaseSession session, int vendorCode, String SQLState)
- Parameters:
session
- SFBaseSessionvendorCode
- the vendor codeSQLState
- the SQL state
-
SnowflakeSQLLoggedException
public SnowflakeSQLLoggedException(String queryId, SFBaseSession session, int vendorCode, String SQLState)
- Parameters:
queryId
- the query IDsession
- SFBaseSessionvendorCode
- the vendor codeSQLState
- the SQL state
-
SnowflakeSQLLoggedException
@Deprecated public SnowflakeSQLLoggedException(SFBaseSession session, String SQLState, String reason)
Deprecated.- Parameters:
session
- SFBaseSessionSQLState
- the SQL statereason
- exception reason
-
SnowflakeSQLLoggedException
public SnowflakeSQLLoggedException(String queryId, SFBaseSession session, String SQLState, String reason)
- Parameters:
queryId
- the query IDsession
- SFBaseSessionSQLState
- the SQL statereason
- the exception reason
-
SnowflakeSQLLoggedException
public SnowflakeSQLLoggedException(SFBaseSession session, int vendorCode, String SQLState, Object... params)
- Parameters:
session
- SFBaseSessionvendorCode
- the vendor codeSQLState
- the SQL stateparams
- additional parameters
-
SnowflakeSQLLoggedException
public SnowflakeSQLLoggedException(String queryId, SFBaseSession session, int vendorCode, String SQLState, Object... params)
- Parameters:
queryId
- the query IDsession
- SFBaseSessionvendorCode
- the vendor codeSQLState
- the SQL stateparams
- additional parameters
-
SnowflakeSQLLoggedException
public SnowflakeSQLLoggedException(SFBaseSession session, ErrorCode errorCode, Throwable ex, Object... params)
- Parameters:
session
- SFBaseSessionerrorCode
- the error codeex
- Throwable exceptionparams
- additional parameters
-
SnowflakeSQLLoggedException
public SnowflakeSQLLoggedException(SFBaseSession session, String SQLState, int vendorCode, Throwable ex, Object... params)
- Parameters:
session
- SFBaseSessionSQLState
- the SQL statevendorCode
- the vendor codeex
- Throwable exceptionparams
- additional parameters
-
SnowflakeSQLLoggedException
public SnowflakeSQLLoggedException(String queryId, SFBaseSession session, String SQLState, int vendorCode, Throwable ex, Object... params)
- Parameters:
queryId
- the query IDsession
- SFBaseSessionSQLState
- the SQL statevendorCode
- the vendor codeex
- Throwable exceptionparams
- additional parameters
-
SnowflakeSQLLoggedException
@Deprecated public SnowflakeSQLLoggedException(SFBaseSession session, ErrorCode errorCode, Object... params)
Deprecated.- Parameters:
session
- SFBaseSessionerrorCode
- the error codeparams
- additional parameters
-
SnowflakeSQLLoggedException
public SnowflakeSQLLoggedException(String queryId, SFBaseSession session, ErrorCode errorCode, Object... params)
- Parameters:
queryId
- the query IDsession
- SFBaseSessionerrorCode
- the error codeparams
- additional parameters
-
SnowflakeSQLLoggedException
public SnowflakeSQLLoggedException(SFBaseSession session, SFException e)
- Parameters:
session
- SFBaseSessione
- throwable exception
-
SnowflakeSQLLoggedException
@Deprecated public SnowflakeSQLLoggedException(SFBaseSession session, String reason)
Deprecated.- Parameters:
session
- SFBaseSessionreason
- exception reason
-
SnowflakeSQLLoggedException
public SnowflakeSQLLoggedException(String queryId, SFBaseSession session, String reason)
- Parameters:
queryId
- the query IDsession
- SFBaseSessionreason
- exception reason
-
-
Method Detail
-
sendTelemetryData
public static void sendTelemetryData(String queryId, String SQLState, int vendorCode, SFBaseSession session, SQLException ex)
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 existsSQLState
- SQLStatevendorCode
- vendor codesession
- session object, which is needed to send in-band telemetry but not oob. Might be null, in which case oob is used.ex
- Exception object
-
-