---
schema_version: "1"
id: 16afc5dea7219682bc21136727eb79b69e83417541369cfa4c5bbe8e599e4074
title: TaxApiException Class
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/apexref/apex_class_commercetax_TaxApiException.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_commercetax_TaxApiException.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: 81983a196ff3ea3d204ef7d04a67006909d79ce71464f0f1caab43b8187f3ec9
description: Contains details about any exceptions during the tax calculation process. Extends the ApexBaseException class.Learn more about the available constructors with the TaxApiException class.Initializes the TaxApiException class using an Exception and a string to provide more details about the exception. This constructor is intended for test usage and throws an exception if used outside of the Apex test context.Initializes the TaxApiException class using an Exception. This constructor is intended for test usage and throws an exception if used outside of the Apex test context.Initializes the TaxApiException class without any initialized parameters. This constructor is intended for test usage and throws an exception if used outside of the Apex test context.
---
# TaxApiException Class

Contains details about any exceptions during the tax calculation process. Extends the ApexBaseException class.

## Namespace

[CommerceTax](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_namespace_commercetax.htm "Manage the communication between Salesforce and an external tax engine.")

- **[TaxApiException Constructors](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_commercetax_TaxApiException.htm#apex_commercetax_TaxApiException_constructors)**  
    Learn more about the available constructors with the TaxApiException class.

## TaxApiException Constructors

Learn more about the available constructors with the TaxApiException class.

The TaxApiException class includes these constructors.

- **[TaxApiException(var1, var2)](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_commercetax_TaxApiException.htm#apex_commercetax_TaxApiException_ctor)**  
    Initializes the TaxApiException class using an Exception and a string to provide more details about the exception. This constructor is intended for test usage and throws an exception if used outside of the Apex test context.
- **[TaxApiException(var1)](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_commercetax_TaxApiException.htm#apex_commercetax_TaxApiException_ctor_2)**  
    Initializes the TaxApiException class using an Exception. This constructor is intended for test usage and throws an exception if used outside of the Apex test context.
- **[TaxApiException()](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_commercetax_TaxApiException.htm#apex_commercetax_TaxApiException_ctor_3)**  
    Initializes the TaxApiException class without any initialized parameters. This constructor is intended for test usage and throws an exception if used outside of the Apex test context.

### TaxApiException(var1, var2)

Initializes the TaxApiException class using an Exception and a string to provide more details about the exception. This constructor is intended for test usage and throws an exception if used outside of the Apex test context.

#### Signature

global TaxApiException(String var1, Exception var2)

#### Parameters

- **var1**:
    
    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.")
    
    Text that provides more information about
    
    the returned exception.
- **var2**:
    
    Type: [Exception](https://developer.salesforce.com/docs/atlas.en-us.264.0.apexref.meta/apexref/apex_classes_exception_methods.htm)
    
    An exception denotes an error that disrupts the normal flow of code execution. You can use Apex built-in exceptions or create custom exceptions. All exceptions have common methods.

### TaxApiException(var1)

Initializes the TaxApiException class using an Exception. This constructor is intended for test usage and throws an exception if used outside of the Apex test context.

#### Signature

global TaxApiException(Exception var1)

#### Parameters

- **var1**:
    
    Type: [Exception](https://developer.salesforce.com/docs/atlas.en-us.264.0.apexref.meta/apexref/apex_classes_exception_methods.htm)
    
    An exception denotes an error that disrupts the normal flow of code execution. You can use Apex built-in exceptions or create custom exceptions. All exceptions have common methods.

### TaxApiException()

Initializes the TaxApiException class without any initialized parameters. This constructor is intended for test usage and throws an exception if used outside of the Apex test context.

#### Signature

global TaxApiException()