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

# OutboundDiscoveryException

> The single exception type outbound discovery throws when a well-known request fails in a way that `AUTH-14` does not treat as a non-fatal fallback: a timeout...

## Definition

**Assembly:** Microsoft.OData.Mcp.Authentication.dll

**Namespace:** Microsoft.OData.Mcp.Authentication.Outbound

**Inheritance:** System.Exception

## Syntax

```csharp theme={null}
Microsoft.OData.Mcp.Authentication.Outbound.OutboundDiscoveryException
```

## Summary

The single exception type outbound discovery throws when a well-known request fails in a way that
`AUTH-14` does not treat as a non-fatal fallback: a timeout, a transport failure, or a repeated
server error after the one retry discovery allows.

## Remarks

Per `specs/v3/AUTHENTICATION.md` AUTH-14, well-known 401/403/404 and a failed parse are not fatal
and never throw this type; only a timeout or a repeated 5xx after retrying once does. Every discovery
failure in this package throws this exception, so a caller can catch one type regardless of which
well-known request failed.

## Examples

```csharp theme={null}
throw new OutboundDiscoveryException(url, (int)response.StatusCode);
```

## Constructors

### &#x20;.ctor

Initializes a new instance of the [OutboundDiscoveryException](https://ai.easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Authentication/Outbound/OutboundDiscoveryException.md) class with a message.

#### Syntax

```csharp theme={null}
public OutboundDiscoveryException(string message)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `message` | `string` | The error message. |

### &#x20;.ctor

Initializes a new instance of the [OutboundDiscoveryException](https://ai.easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Authentication/Outbound/OutboundDiscoveryException.md) class with a message and
the exception that caused this failure.

#### Syntax

```csharp theme={null}
public OutboundDiscoveryException(string message, System.Exception inner)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `message` | `string` | The error message. |
| `inner` | `System.Exception` | The exception that caused this failure. |

### &#x20;.ctor

Initializes a new instance of the [OutboundDiscoveryException](https://ai.easyaf.dev/odata-mcp/api-reference/Microsoft/OData/Mcp/Authentication/Outbound/OutboundDiscoveryException.md) class for a well-known
request that failed with an HTTP status code.

#### Syntax

```csharp theme={null}
public OutboundDiscoveryException(System.Uri url, int statusCode)
```

#### Parameters

| Name | Type | Description |
| - | - | - |
| `url` | `System.Uri` | The well-known URL that was requested. |
| `statusCode` | `int` | The HTTP status code the request failed with. |

#### Exceptions

| Exception | Description |
| - | - |
| `ArgumentNullException` | Thrown when *url* is [`null`](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null). |

## Properties

### &#x20;StatusCode

Gets the HTTP status code the failing request returned, or [`null`](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null) when the failure
was a transport exception with no response.

#### Syntax

```csharp theme={null}
public System.Nullable<int> StatusCode { get; }
```

#### Property Value

Type: `System.Nullable<int>`

### &#x20;Url

Gets the well-known URL the failing request was sent to, or [`null`](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null) when this
instance was constructed with only a message.

#### Syntax

```csharp theme={null}
public System.Uri Url { get; }
```

#### Property Value

Type: `System.Uri?`


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