-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDuplicateProfileNameException.cs
More file actions
47 lines (43 loc) · 1.78 KB
/
Copy pathDuplicateProfileNameException.cs
File metadata and controls
47 lines (43 loc) · 1.78 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
namespace S7Tools.Core.Exceptions;
/// <summary>
/// Exception thrown when attempting to create or rename a profile with a name that already exists.
/// </summary>
public class DuplicateProfileNameException : ProfileException
{
/// <summary>
/// Gets the duplicate profile name that caused the exception.
/// </summary>
public string DuplicateName { get; }
/// <summary>
/// Initializes a new instance of the <see cref="DuplicateProfileNameException"/> class.
/// </summary>
/// <param name="profileName">The duplicate profile name.</param>
public DuplicateProfileNameException(string profileName)
: base($"A profile with the name '{profileName}' already exists.")
{
DuplicateName = profileName;
ProfileName = profileName;
}
/// <summary>
/// Initializes a new instance of the <see cref="DuplicateProfileNameException"/> class with a custom message.
/// </summary>
/// <param name="profileName">The duplicate profile name.</param>
/// <param name="message">The custom error message.</param>
public DuplicateProfileNameException(string profileName, string message)
: base(message)
{
DuplicateName = profileName;
ProfileName = profileName;
}
/// <summary>
/// Initializes a new instance of the <see cref="DuplicateProfileNameException"/> class with inner exception.
/// </summary>
/// <param name="profileName">The duplicate profile name.</param>
/// <param name="innerException">The inner exception.</param>
public DuplicateProfileNameException(string profileName, Exception innerException)
: base($"A profile with the name '{profileName}' already exists.", innerException)
{
DuplicateName = profileName;
ProfileName = profileName;
}
}