---
schema_version: "1"
id: 5dd7df805b4e4019db8cfd7b38e317a1d68cfe71a1e0fba436b58c8d6715349e
title: DataSourceUtil Class
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/apexref/apex_class_DataSource_DataSourceUtil.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_DataSource_DataSourceUtil.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: adfbda09a3312bf9130ab454cea6ab2a1b7622a9f57e790fa027ab260f2c758f
description: Parent class for the DataSource.Provider, DataSource.Connection, DataSource.Table, and DataSource.Column classes.Logs the error message in the debug log.Throws a DataSourceException and displays the provided message to the user.
---
# DataSourceUtil Class

Parent class for the DataSource.Provider, DataSource.Connection, DataSource.Table, and DataSource.Column classes.

## Namespace

[DataSource](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_namespace_DataSource.htm "The DataSource namespace provides the classes for the Apex Connector Framework. Use the Apex Connector Framework to develop a custom adapter for Salesforce Connect. Then connect your Salesforce organization to any data anywhere via the Salesforce Connect custom adapter.")

- **[DataSourceUtil Methods](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_DataSource_DataSourceUtil.htm#apex_DataSource_DataSourceUtil_methods)**

## DataSourceUtil Methods

The following are methods for DataSourceUtil.

- **[logWarning(message)](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_DataSource_DataSourceUtil.htm#apex_DataSource_DataSourceUtil_logWarning)**  
    Logs the error message in the debug log.
- **[throwException(message)](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_DataSource_DataSourceUtil.htm#apex_DataSource_DataSourceUtil_throwException)**  
    Throws a DataSourceException and displays the provided message to the user.

### logWarning(message)

Logs the error message in the debug log.

#### Signature

public void logWarning(String message)

#### Parameters

- **message**:
    
    Type: [String](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_string.htm#apex_methods_system_string "Contains methods for the String primitive data type.")
    
    The error message.

#### Return Value

Type: void

### throwException(message)

Throws a DataSourceException and displays the provided message to the user.

#### Signature

public void throwException(String message)

#### Parameters

- **message**:
    
    Type: [String](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_string.htm#apex_methods_system_string "Contains methods for the String primitive data type.") Error message to display to the user.

#### Return Value

Type: void