# WrappedException.CreateAndRethrow(Exception)

[Type overview](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.runtime.wrappedexception/) | [Methods](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.runtime.wrappedexception/methods/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Orleans.Core.Abstractions/Exceptions/WrappedException.cs#L70-L78)

```csharp
public static void CreateAndRethrow(Exception exception)
```

Creates a new instance of the [WrappedException](/orleans/docs/api/csharp/microsoft.orleans.core.abstractions/orleans.runtime.wrappedexception/) class and rethrows it using the provided exception's stack trace.

### Parameters

- `exception` (`Exception`): The exception.
