Package net.snowflake.client.api.loader

## Class LoadingError

- java.lang.Object
- - net.snowflake.client.api.loader.LoadingError

    public class LoadingError
    extends Object

Wrapper for data format errors returned by the COPY/validate command.

This class encapsulates error information from failed data loading operations. It provides details about what went wrong, where in the file the error occurred, and the rejected record data.

## Usage Example

     LoadResultListener listener = new LoadResultListener() {
       public void addError(LoadingError error) {
         System.err.println("Error in file: " + error.getFile());
         System.err.println("Line: " + error.getProperty(ErrorProperty.LINE));
         System.err.println("Error: " + error.getProperty(ErrorProperty.ERROR));
       }
       // ... implement other methods
     };

See Also:
  `LoadResultListener`, `Loader`

### Nested Class Summary

Nested Classes
`static class` `LoadingError.ErrorProperty` Properties that can be associated with a loading error.

### Field Summary

Fields
`static String` `UNKNOWN`

### Constructor Summary

Constructors
`LoadingError​(ResultSet rs, net.snowflake.client.internal.loader.BufferStage bs, net.snowflake.client.internal.loader.StreamLoader loader)` Construct error from validation output

### Method Summary

All Methods Instance Methods Concrete Methods
`Loader.DataError` `getException()` Converts this loading error into a DataError exception.
`String` `getFile()` Gets the file name where the error occurred.
`String` `getPrefix()` Gets the file prefix within the stage.
`String` `getProperty​(LoadingError.ErrorProperty p)` Gets the value of a specific error property.
`String` `getStage()` Gets the stage name where the error occurred.
`String` `getTarget()` Gets the target table name.
`void` `setProperty​(LoadingError.ErrorProperty p, String value)` Sets the value of a specific error property.
`String` `toString()`

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

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

### Field Detail

#### UNKNOWN

    public static String UNKNOWN

### Constructor Detail

#### LoadingError

    public LoadingError​(ResultSet rs,
                        net.snowflake.client.internal.loader.BufferStage bs,
                        net.snowflake.client.internal.loader.StreamLoader loader)

Construct error from validation output

Parameters:
  `rs` - result set
  `bs` - buffer stage
  `loader` - stream loader

### Method Detail

#### getStage

    public String getStage()

Gets the stage name where the error occurred.

Returns:
  the stage name

#### getPrefix

    public String getPrefix()

Gets the file prefix within the stage.

Returns:
  the file prefix path

#### getFile

    public String getFile()

Gets the file name where the error occurred.

Returns:
  the file name

#### getTarget

    public String getTarget()

Gets the target table name.

Returns:
  the target table name

#### getProperty

    public String getProperty​(LoadingError.ErrorProperty p)

Gets the value of a specific error property.

Parameters:
  `p` - the error property to retrieve
Returns:
  the value of the error property, or null if not set

#### setProperty

    public void setProperty​(LoadingError.ErrorProperty p,
                            String value)

Sets the value of a specific error property.

Parameters:
  `p` - the error property to set
  `value` - the value to assign to the property

#### toString

    public String toString()

Overrides:
  `toString` in class `Object`

#### getException

    public Loader.DataError getException()

Converts this loading error into a DataError exception.

Returns:
  a DataError exception containing this error's details