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

# Exception

> Extension methods for Exception from System.Runtime

## Definition

**Assembly:** System.Runtime.dll

**Namespace:** System

## Syntax

```csharp theme={"dark"}
System.Exception
```

## Summary

This type is defined in System.Runtime.

## Remarks

See [Microsoft documentation](https://learn.microsoft.com/dotnet/api/system.exception) for more information about the rest of the API.

## Methods

### <Icon icon="puzzle-piece" iconType="duotone" color="#E0EC32" size={24} className="mr-2" /> TraceDemystifiedException <Badge color="green">Extension</Badge>

<Note>Extension method from `System.EasyAF_ExceptionExtensions`</Note>

Demystifies the Exception and writes it to [Object\[\])](https://learn.microsoft.com/dotnet/api/system.diagnostics.trace.traceerror\(system.string,system.object\[]\)).

#### Syntax

```csharp theme={"dark"}
public static System.Exception TraceDemystifiedException(System.Exception ex, string logPrefix = "")
```

#### Parameters

| Name        | Type               | Description                                                                              |
| ----------- | ------------------ | ---------------------------------------------------------------------------------------- |
| `ex`        | `System.Exception` | The exception instance to manipulate.                                                    |
| `logPrefix` | `string`           | A string that will be prepended to the log entry. Defaults to the calling function name. |

#### Returns

Type: `System.Exception`
The Demystified exception.
