diff options
Diffstat (limited to 'src/Cepis/InvalidResponseException.cs')
| -rw-r--r-- | src/Cepis/InvalidResponseException.cs | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/Cepis/InvalidResponseException.cs b/src/Cepis/InvalidResponseException.cs new file mode 100644 index 0000000..e0be6b5 --- /dev/null +++ b/src/Cepis/InvalidResponseException.cs @@ -0,0 +1,27 @@ +namespace Cepis; + +/// <summary> +/// A success status came back with a body that cannot be parsed. +/// </summary> +/// <remarks> +/// In practice this means something between you and the API is answering +/// instead of it — a captive Wi-Fi portal, a corporate proxy, an HTML error +/// page. Useful as a diagnosis: the problem is not in your code. +/// </remarks> +public sealed class InvalidResponseException : CepisException +{ + /// <summary>Create the exception with a message.</summary> + /// <param name="message">what went wrong</param> + public InvalidResponseException(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 parse failure underneath</param> + public InvalidResponseException(string message, Exception? innerException) + : base(message, innerException) + { + } +} |