> ## Documentation Index
> Fetch the complete documentation index at: https://easyaf.dev/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](/breakdance/api-reference/CloudNimble/Breakdance/DotHttp/DotHttpAssertions) 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

### <Icon icon="hammer" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> .ctor

Initializes a new instance of the [DotHttpAssertionException](/breakdance/api-reference/CloudNimble/Breakdance/DotHttp/DotHttpAssertionException) class.

#### Syntax

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

### <Icon icon="hammer" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> .ctor

Initializes a new instance of the [DotHttpAssertionException](/breakdance/api-reference/CloudNimble/Breakdance/DotHttp/DotHttpAssertionException) 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. |

### <Icon icon="hammer" iconType="duotone" color="#419AC5" size={24} className="mr-2" /> .ctor

Initializes a new instance of the [DotHttpAssertionException](/breakdance/api-reference/CloudNimble/Breakdance/DotHttp/DotHttpAssertionException) 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. |
