> ## 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.

# StatusCodeException

> Use this exception when you want to return a specific status code

## Definition

**Assembly:** Microsoft.Restier.Core.dll

**Namespace:** Microsoft.Restier.Core

**Inheritance:** System.Exception

## Syntax

```csharp theme={"dark"}
Microsoft.Restier.Core.StatusCodeException
```

## Summary

Use this exception when you want to return a specific status code

## Constructors

### &#x20;.ctor

Initializes a new instance of the StatusCodeException class.

#### Syntax

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

### &#x20;.ctor

Initializes a new instance of the StatusCodeException class.

#### Syntax

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

#### Parameters

| Name | Type | Description |
| - | - | - |
| `message` | `string` | Plain text error message for this exception. |

### &#x20;.ctor

Initializes a new instance of the StatusCodeException class.

#### Syntax

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

#### Parameters

| Name | Type | Description |
| - | - | - |
| `message` | `string` | Plain text error message for this exception. |
| `innerException` | `System.Exception` | Exception that caused this exception to be thrown. |

### &#x20;.ctor

Initializes a new instance of the StatusCodeException class.

#### Syntax

```csharp theme={"dark"}
public StatusCodeException(System.Net.HttpStatusCode statusCode, string message)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `statusCode` | `System.Net.HttpStatusCode` | - |
| `message` | `string` | Plain text error message for this exception. |

### &#x20;.ctor

Initializes a new instance of the StatusCodeException class.

#### Syntax

```csharp theme={"dark"}
public StatusCodeException(System.Net.HttpStatusCode statusCode, string message, System.Exception innerException)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `statusCode` | `System.Net.HttpStatusCode` | - |
| `message` | `string` | Plain text error message for this exception. |
| `innerException` | `System.Exception` | Exception that caused this exception to be thrown. |

## Properties

### &#x20;StatusCode

#### Syntax

```csharp theme={"dark"}
public System.Net.HttpStatusCode StatusCode { get; private set; }
```

#### Property Value

Type: `System.Net.HttpStatusCode`


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