net.snowflake.client.core

## Class IncidentUtil

- java.lang.Object
- - net.snowflake.client.core.IncidentUtil

    public class IncidentUtil
    extends Object

Author:
  jrosen + mkeller

### Field Summary

Fields
`static String` `INC_DUMP_FILE_EXT`
`static String` `INC_DUMP_FILE_NAME`
`static String` `INCIDENT_INFO`
`static String` `TIMESTAMP`

### Constructor Summary

Constructors
Constructor and Description
`IncidentUtil()`

### Method Summary

All Methods Static Methods Concrete Methods
`static void` `dumpVmMetrics(String incidentId)` Dumps JVM metrics for this process.
`static Throwable` `generateIncidentV2WithException(SFBaseSession session, Throwable exc, String jobId, String requestId)` Makes a V2 incident object and triggers ir, effectively reporting the given exception to GS and possibly to crashmanager
`static Throwable` `generateIncidentV2WithException(String serverUrl, String sessionToken, Throwable exc, String jobId, String requestId)` Makes a V2 incident object and triggers it, effectively reporting the given exception to GS and possibly to crashmanager.
`static String` `oneLiner(String prefix, Throwable thrown)` Produce a one line description of the throwable, suitable for error message and log printing with a prefix
`static String` `oneLiner(Throwable thrown)` Produce a one line description of the throwable, suitable for error message and log printing.

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

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

### Field Detail

#### TIMESTAMP

    public static final String TIMESTAMP

See Also:
  Constant Field Values

#### INCIDENT_INFO

    public static final String INCIDENT_INFO

See Also:
  Constant Field Values

#### INC_DUMP_FILE_NAME

    public static final String INC_DUMP_FILE_NAME

See Also:
  Constant Field Values

#### INC_DUMP_FILE_EXT

    public static final String INC_DUMP_FILE_EXT

See Also:
  Constant Field Values

### Constructor Detail

#### IncidentUtil

    public IncidentUtil()

### Method Detail

#### oneLiner

    public static String oneLiner(Throwable thrown)

Produce a one line description of the throwable, suitable for error message and log printing.

Parameters:
  `thrown` - thrown object
Returns:
  description of the thrown object

#### oneLiner

    public static String oneLiner(String prefix,
                                  Throwable thrown)

Produce a one line description of the throwable, suitable for error message and log printing with a prefix

Parameters:
  `prefix` - String to prefix oneliner summary
  `thrown` - thrown object
Returns:
  description of the thrown object

#### dumpVmMetrics

    public static void dumpVmMetrics(String incidentId)

Dumps JVM metrics for this process.

Parameters:
  `incidentId` - incident id

#### generateIncidentV2WithException

    public static Throwable generateIncidentV2WithException(SFBaseSession session,
                                                            Throwable exc,
                                                            String jobId,
                                                            String requestId)

Makes a V2 incident object and triggers ir, effectively reporting the given exception to GS and possibly to crashmanager

Parameters:
  `session` - SFSession object to talk to GS through
  `exc` - the Throwable we should report
  `jobId` - jobId that failed
  `requestId` - requestId that failed
Returns:
  the given Throwable object

#### generateIncidentV2WithException

    public static Throwable generateIncidentV2WithException(String serverUrl,
                                                            String sessionToken,
                                                            Throwable exc,
                                                            String jobId,
                                                            String requestId)

Makes a V2 incident object and triggers it, effectively reporting the given exception to GS and possibly to crashmanager.

This function should be proceeded by a throw as it returns the originally given exception.

Parameters:
  `serverUrl` - url of GS to report incident to
  `sessionToken` - session token to be used to report incident
  `exc` - the Throwable we should report
  `jobId` - jobId that failed
  `requestId` - requestId that failed
Returns:
  the given Exception object