-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProfileException.cs
More file actions
71 lines (64 loc) · 2.56 KB
/
ProfileException.cs
File metadata and controls
71 lines (64 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
68
69
70
71
namespace S7Tools.Core.Exceptions;
/// <summary>
/// Base exception class for profile-related errors.
/// Provides context about which profile caused the exception.
/// </summary>
public class ProfileException : S7ToolsException
{
/// <summary>
/// Gets the ID of the profile that caused the exception, if available.
/// </summary>
public int? ProfileId { get; init; }
/// <summary>
/// Gets the name of the profile that caused the exception, if available.
/// </summary>
public string? ProfileName { get; init; }
/// <summary>
/// Initializes a new instance of the <see cref="ProfileException"/> class.
/// </summary>
public ProfileException()
{
}
/// <summary>
/// Initializes a new instance of the <see cref="ProfileException"/> class with a specified error message.
/// </summary>
/// <param name="message">The message that describes the error.</param>
public ProfileException(string message)
: base(message)
{
}
/// <summary>
/// Initializes a new instance of the <see cref="ProfileException"/> class with a specified error message
/// and profile ID.
/// </summary>
/// <param name="message">The message that describes the error.</param>
/// <param name="profileId">The ID of the profile that caused the exception.</param>
public ProfileException(string message, int profileId)
: base(message)
{
ProfileId = profileId;
}
/// <summary>
/// Initializes a new instance of the <see cref="ProfileException"/> class with a specified error message,
/// profile ID, and profile name.
/// </summary>
/// <param name="message">The message that describes the error.</param>
/// <param name="profileId">The ID of the profile that caused the exception.</param>
/// <param name="profileName">The name of the profile that caused the exception.</param>
public ProfileException(string message, int profileId, string profileName)
: base(message)
{
ProfileId = profileId;
ProfileName = profileName;
}
/// <summary>
/// Initializes a new instance of the <see cref="ProfileException"/> class with a specified error message
/// and a reference to the 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 ProfileException(string message, Exception innerException)
: base(message, innerException)
{
}
}