-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProfileNotFoundException.cs
More file actions
46 lines (42 loc) · 1.75 KB
/
ProfileNotFoundException.cs
File metadata and controls
46 lines (42 loc) · 1.75 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
namespace S7Tools.Core.Exceptions;
/// <summary>
/// Exception thrown when a requested profile cannot be found.
/// </summary>
public class ProfileNotFoundException : ProfileException
{
/// <summary>
/// Initializes a new instance of the <see cref="ProfileNotFoundException"/> class with a profile ID.
/// </summary>
/// <param name="profileId">The ID of the profile that was not found.</param>
public ProfileNotFoundException(int profileId)
: base($"Profile with ID {profileId} was not found.", profileId)
{
}
/// <summary>
/// Initializes a new instance of the <see cref="ProfileNotFoundException"/> class with a profile ID and name.
/// </summary>
/// <param name="profileId">The ID of the profile that was not found.</param>
/// <param name="profileName">The name of the profile that was not found.</param>
public ProfileNotFoundException(int profileId, string profileName)
: base($"Profile '{profileName}' (ID: {profileId}) was not found.", profileId, profileName)
{
}
/// <summary>
/// Initializes a new instance of the <see cref="ProfileNotFoundException"/> class with a custom message.
/// </summary>
/// <param name="message">The custom error message.</param>
public ProfileNotFoundException(string message)
: base(message)
{
}
/// <summary>
/// Initializes a new instance of the <see cref="ProfileNotFoundException"/> class with a custom message
/// and inner exception.
/// </summary>
/// <param name="message">The custom error message.</param>
/// <param name="innerException">The inner exception.</param>
public ProfileNotFoundException(string message, Exception innerException)
: base(message, innerException)
{
}
}