> ## Documentation Index
> Fetch the complete documentation index at: https://easyaf.nimbleapps.cloud/llms.txt
> Use this file to discover all available pages before exploring further.

# DotHttpAssertionException

> Exception thrown when a DotHttp assertion fails.

## Definition

**Assembly:** CloudNimble.Breakdance.DotHttp.dll

**Namespace:** CloudNimble.Breakdance.DotHttp

**Inheritance:** System.Exception

## Syntax

```csharp theme={"dark"}
CloudNimble.Breakdance.DotHttp.DotHttpAssertionException
```

## Summary

Exception thrown when a DotHttp assertion fails.

## Remarks

This exception is thrown by [DotHttpAssertions](https://easyaf.nimbleapps.cloud/breakdance/api-reference/CloudNimble/Breakdance/DotHttp/DotHttpAssertions.md) methods when
HTTP response validation fails.

## Examples

```csharp theme={"dark"}
try
{
    await DotHttpAssertions.AssertValidResponseAsync(response);
}
catch (DotHttpAssertionException ex)
{
    Console.WriteLine($"Assertion failed: {ex.Message}");
}
```

## Constructors

### &#x20;.ctor

Initializes a new instance of the [DotHttpAssertionException](https://easyaf.nimbleapps.cloud/breakdance/api-reference/CloudNimble/Breakdance/DotHttp/DotHttpAssertionException.md) class.

#### Syntax

```csharp theme={"dark"}
public DotHttpAssertionException()
```

### &#x20;.ctor

Initializes a new instance of the [DotHttpAssertionException](https://easyaf.nimbleapps.cloud/breakdance/api-reference/CloudNimble/Breakdance/DotHttp/DotHttpAssertionException.md) class
with a specified error message.

#### Syntax

```csharp theme={"dark"}
public DotHttpAssertionException(string message)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `message` | `string` | The message that describes the error. |

### &#x20;.ctor

Initializes a new instance of the [DotHttpAssertionException](https://easyaf.nimbleapps.cloud/breakdance/api-reference/CloudNimble/Breakdance/DotHttp/DotHttpAssertionException.md) class
with a specified error message and inner exception.

#### Syntax

```csharp theme={"dark"}
public DotHttpAssertionException(string message, System.Exception innerException)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `message` | `string` | The message that describes the error. |
| `innerException` | `System.Exception` | The exception that is the cause of the current exception. |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.