diff options
Diffstat (limited to 'src/Cepis/NetworkException.cs')
| -rw-r--r-- | src/Cepis/NetworkException.cs | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/Cepis/NetworkException.cs b/src/Cepis/NetworkException.cs new file mode 100644 index 0000000..cb7ea77 --- /dev/null +++ b/src/Cepis/NetworkException.cs @@ -0,0 +1,27 @@ +namespace Cepis; + +/// <summary> +/// The request never completed: DNS, a refused connection, a timeout, TLS. +/// </summary> +/// <remarks> +/// Thrown only after every configured attempt has failed. A cancellation +/// requested by the caller is not this — that surfaces as +/// <see cref="OperationCanceledException"/>, untouched. +/// </remarks> +public sealed class NetworkException : CepisException +{ + /// <summary>Create the exception with a message.</summary> + /// <param name="message">what went wrong</param> + public NetworkException(string message) + : base(message) + { + } + + /// <summary>Create the exception with a message and an underlying cause.</summary> + /// <param name="message">what went wrong</param> + /// <param name="innerException">the transport failure underneath</param> + public NetworkException(string message, Exception? innerException) + : base(message, innerException) + { + } +} |