---
schema_version: "1"
id: 7b9e5c4d5ff53bd52b21a50a6bc19089b3281b48f4232e37f572c2e15b9071de
title: Class DataApiException
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/salesforce-functions/functions/guide/javasdk/classes/java-dataapiexception.md
canonical_url: https://developer.salesforce.com/docs/platform/functions/guide/java-dataapiexception.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: bd498a5d2f04ee32d37dddcc97c7fba474779d6862c30530c9b7a43c45db7b9e
products:
  - Salesforce Functions
---
# Class DataApiException

java.lang.Object
java.lang.Throwable
java.lang.Exception
com.salesforce.functions.jvm.sdk.data.error.DataApiException
All Implemented Interfaces: `java.io.Serializable`

------------------------------------------------------------------------

public final class DataApiException extends java.lang.Exception

Signals that a data API error occurred.

## Constructor Summary

| Constructor                                                                       | Description                                                                             |
| --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- |
| `DataApiException (java.lang.String message)`                                     | Constructs a DataApiException with the specified detail message.                        |
| `DataApiException (java.lang.String message,java.lang.Throwable cause)`           | Constructs a DataApiException with the specified detail message and cause.              |
| `DataApiException (java.lang.String message,java.util.List<DataApiError> errors)` | Constructs a DataApiException with the specified detail message and list of API errors. |

## Method Summary

| Modifier and Type              | Method               | Description                                         |
| ------------------------------ | -------------------- | --------------------------------------------------- |
| `java.util.List<DataApiError>` | `getDataApiErrors()` | Returns the list of `DataApiError` s that occurred. |

### Methods inherited from class java.lang.Throwable {#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 {#methods.inherited.from.class.java.lang.Object}

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

## Constructor Details

### DataApiException

public DataApiException​(java.lang.String message)

Constructs a DataApiException with the specified detail message.

Parameters: `message` - The detail message (which is saved for later
retrieval by the `Throwable.getMessage()` method)

### DataApiException

public DataApiException​(java.lang.String message,
java.lang.Throwable cause)

Constructs a DataApiException with the specified detail message and
cause.

Parameters: `message` - The detail message (which is saved for later
retrieval by the `Throwable.getMessage()` method) `cause` - The cause
(which is saved for later retrieval by the `Throwable.getCause()`
method). (A null value is permitted, and indicates that the cause is
nonexistent or unknown.)

### DataApiException

public DataApiException​(java.lang.String message,
java.util.List\<DataApiError\> errors)

Constructs a DataApiException with the specified detail message and list
of API errors.

Parameters: `message` - The detail message (which is saved for later
retrieval by the `Throwable.getMessage()` method) `errors` - The list
API errors (which is saved for later retrieval by the
`getDataApiErrors()` method)

## Method Details

### getDataApiErrors

\@Nonnull public java.util.List\<DataApiError\> getDataApiErrors()

Returns the list of `DataApiError`s that occurred. This list might be
empty if the exception wasn\'t caused by an API error.

Returns: The list of `DataApiError`s that occurred.
