| | 1 | | using System; |
| | 2 | |
|
| | 3 | | namespace Plainquire.Filter.Abstractions.Exceptions; |
| | 4 | |
|
| | 5 | | // Copy from .NET 7, System.Diagnostics.UnreachableException |
| | 6 | |
|
| | 7 | | /// <summary> |
| | 8 | | /// Exception thrown when the program executes an instruction that was thought to be unreachable. |
| | 9 | | /// </summary> |
| | 10 | | public sealed class UnreachableException : Exception |
| | 11 | | { |
| | 12 | | /// <summary> |
| | 13 | | /// Initializes a new instance of the <see cref="UnreachableException"/> class with the default error message. |
| | 14 | | /// </summary> |
| | 15 | | public UnreachableException() |
| 0 | 16 | | : base("The program executed an instruction that was thought to be unreachable.") |
| | 17 | | { |
| 0 | 18 | | } |
| | 19 | |
|
| | 20 | | /// <summary> |
| | 21 | | /// Initializes a new instance of the <see cref="UnreachableException"/> |
| | 22 | | /// class with a specified error message. |
| | 23 | | /// </summary> |
| | 24 | | /// <param name="message">The error message that explains the reason for the exception.</param> |
| | 25 | | public UnreachableException(string? message) |
| 0 | 26 | | : base(message) |
| | 27 | | { |
| 0 | 28 | | } |
| | 29 | |
|
| | 30 | | /// <summary> |
| | 31 | | /// Initializes a new instance of the <see cref="UnreachableException"/> |
| | 32 | | /// class with a specified error message and a reference to the inner exception that is the cause of |
| | 33 | | /// this exception. |
| | 34 | | /// </summary> |
| | 35 | | /// <param name="message">The error message that explains the reason for the exception.</param> |
| | 36 | | /// <param name="innerException">The exception that is the cause of the current exception.</param> |
| | 37 | | public UnreachableException(string? message, Exception? innerException) |
| 0 | 38 | | : base(message, innerException) |
| | 39 | | { |
| 0 | 40 | | } |
| | 41 | | } |