-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduced custom exceptions and better error handling.
- Loading branch information
1 parent
0e027d6
commit dbfdf9b
Showing
7 changed files
with
118 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
TlsCertificateLoader/Exceptions/AdditionalCertificatesNotFoundException.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
|
||
namespace TlsCertificateLoader.Exceptions | ||
{ | ||
/// <summary> | ||
/// The exception that is thrown when the additional certificates requested are not found in the dictionary. | ||
/// </summary> | ||
[Serializable] | ||
public sealed class AdditionalCertificatesNotFoundException : KeyNotFoundException | ||
{ | ||
/// <summary> | ||
/// The hostname provided | ||
/// </summary> | ||
public string HostName { get; internal set; } | ||
|
||
internal AdditionalCertificatesNotFoundException(string hostname) : base("Additional certificates not found.") | ||
{ | ||
HostName = hostname; | ||
} | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
TlsCertificateLoader/Exceptions/AdditionalCertificatesNotInitializedException.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
using System; | ||
|
||
namespace TlsCertificateLoader.Exceptions | ||
{ | ||
/// <summary> | ||
/// The exception that is thrown when additional certificates are not initialized. | ||
/// </summary> | ||
[Serializable] | ||
public sealed class AdditionalCertificatesNotInitializedException : InvalidOperationException | ||
{ | ||
internal AdditionalCertificatesNotInitializedException() : base("Additional certificates not initialized.") | ||
{ } | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
TlsCertificateLoader/Exceptions/DefaultCertificatesNotInitializedException.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
using System; | ||
|
||
namespace TlsCertificateLoader.Exceptions | ||
{ | ||
/// <summary> | ||
/// The exception that is thrown when the default certificates are not initialized. | ||
/// </summary> | ||
[Serializable] | ||
public sealed class DefaultCertificatesNotInitializedException : InvalidOperationException | ||
{ | ||
internal DefaultCertificatesNotInitializedException() : base("Default certificates not initialized.") | ||
{ } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters