-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathConfigurationException.cs
More file actions
67 lines (60 loc) · 2.56 KB
/
ConfigurationException.cs
File metadata and controls
67 lines (60 loc) · 2.56 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
55
56
57
58
59
60
61
62
63
64
65
66
67
namespace S7Tools.Core.Exceptions;
/// <summary>
/// Exception thrown when a configuration-related error occurs.
/// This includes invalid settings, missing configuration files, or configuration parsing errors.
/// </summary>
public class ConfigurationException : S7ToolsException
{
/// <summary>
/// Gets the name of the configuration setting that caused the error, if applicable.
/// </summary>
public string? SettingName { get; init; }
/// <summary>
/// Gets the configuration file path that caused the error, if applicable.
/// </summary>
public string? ConfigurationPath { get; init; }
/// <summary>
/// Initializes a new instance of the <see cref="ConfigurationException"/> class.
/// </summary>
public ConfigurationException()
{
}
/// <summary>
/// Initializes a new instance of the <see cref="ConfigurationException"/> class with a specified error message.
/// </summary>
/// <param name="message">The message that describes the error.</param>
public ConfigurationException(string message)
: base(message)
{
}
/// <summary>
/// Initializes a new instance of the <see cref="ConfigurationException"/> class with a setting name.
/// </summary>
/// <param name="message">The message that describes the error.</param>
/// <param name="settingName">The name of the configuration setting that caused the error.</param>
public ConfigurationException(string message, string settingName)
: base(message)
{
SettingName = settingName;
}
/// <summary>
/// Initializes a new instance of the <see cref="ConfigurationException"/> class with inner exception.
/// </summary>
/// <param name="message">The error message that explains the reason for the exception.</param>
/// <param name="innerException">The exception that is the cause of the current exception.</param>
public ConfigurationException(string message, Exception innerException)
: base(message, innerException)
{
}
/// <summary>
/// Initializes a new instance of the <see cref="ConfigurationException"/> class with setting name and inner exception.
/// </summary>
/// <param name="message">The message that describes the error.</param>
/// <param name="settingName">The name of the configuration setting.</param>
/// <param name="innerException">The inner exception.</param>
public ConfigurationException(string message, string settingName, Exception innerException)
: base(message, innerException)
{
SettingName = settingName;
}
}