forked from cosullivan/SmtpServer
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSmtpResponseException.cs
More file actions
54 lines (47 loc) · 1.96 KB
/
Copy pathSmtpResponseException.cs
File metadata and controls
54 lines (47 loc) · 1.96 KB
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
using System;
using System.Collections.Generic;
namespace SmtpServer.Protocol
{
/// <summary>
/// Smtp Response Exception
/// </summary>
public sealed class SmtpResponseException : Exception
{
static readonly IReadOnlyDictionary<string, object> Empty = new Dictionary<string, object>();
/// <summary>
/// Constructor.
/// </summary>
/// <param name="response">The response to raise in the exception.</param>
public SmtpResponseException(SmtpResponse response) : this(response, false) { }
/// <summary>
/// Constructor.
/// </summary>
/// <param name="response">The response to raise in the exception.</param>
/// <param name="quit">Indicates whether or not the session should terminate.</param>
public SmtpResponseException(SmtpResponse response, bool quit) : this(response, quit, Empty) { }
/// <summary>
/// Constructor.
/// </summary>
/// <param name="response">The response to raise in the exception.</param>
/// <param name="quit">Indicates whether or not the session should terminate.</param>
/// <param name="properties">The contextual properties to include as metadata for the exception.</param>
public SmtpResponseException(SmtpResponse response, bool quit, IReadOnlyDictionary<string, object> properties)
{
Response = response;
IsQuitRequested = quit;
Properties = properties;
}
/// <summary>
/// The response to return to the client.
/// </summary>
public SmtpResponse Response { get; }
/// <summary>
/// Indicates whether or not the session should terminate.
/// </summary>
public bool IsQuitRequested { get; }
/// <summary>
/// Returns a set of propeties for the current session.
/// </summary>
public IReadOnlyDictionary<string, object> Properties { get; }
}
}