blob: 50af442e015081991683cc6afdca5d2b997ed766 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
namespace Cepis;
/// <summary>
/// The base of every error this library raises. Catch it to handle any failure.
/// </summary>
/// <remarks>
/// <para>
/// Below this type the split is by <b>the decision the caller has to make</b>,
/// not by the HTTP status that caused it.
/// <see cref="InvalidCepException"/> and <see cref="CepNotFoundException"/> are
/// problems with the <i>request</i>: retrying is pointless, the same CEP will
/// fail again. <see cref="NetworkException"/>, <see cref="ServerErrorException"/>
/// and <see cref="RateLimitedException"/> are problems with <i>transport</i>:
/// retrying may help, and the client already retried on its own before throwing
/// any of them.
/// </para>
/// <para>
/// C# allows one base class, so these are not also <see cref="ArgumentException"/>
/// or <see cref="KeyNotFoundException"/>: one base type that catches every
/// failure is worth more.
/// </para>
/// </remarks>
public abstract class CepisException : Exception
{
/// <summary>Create the exception with a message.</summary>
/// <param name="message">what went wrong</param>
protected CepisException(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 failure underneath, if any</param>
protected CepisException(string message, Exception? innerException)
: base(message, innerException)
{
}
}
|