| | 1 | | // Copyright (c) ZeroC, Inc. |
| | 2 | |
|
| | 3 | | using System.Diagnostics; |
| | 4 | | using System.Runtime.ExceptionServices; |
| | 5 | |
|
| | 6 | | namespace IceRpc.Internal; |
| | 7 | |
|
| | 8 | | internal static class ExceptionUtil |
| | 9 | | { |
| | 10 | | /// <summary>Rethrows an exception while preserving its stack trace. This method does not return and |
| | 11 | | /// is typically called as: <c>throw ExceptionUtil.Throw(ex);</c>.</summary> |
| | 12 | | internal static Exception Throw(Exception exception) |
| 231 | 13 | | { |
| 231 | 14 | | ExceptionDispatchInfo.Throw(exception); |
| 0 | 15 | | Debug.Assert(false); |
| 0 | 16 | | return exception; |
| 0 | 17 | | } |
| | 18 | | } |