|
1 | 1 | using System;
|
2 |
| -using System.Runtime.Serialization; |
3 | 2 | using GuardNet;
|
4 | 3 |
|
5 | 4 | namespace Arcus.Security.Core
|
6 | 5 | {
|
7 | 6 | /// <summary>
|
8 | 7 | /// Exception, thrown when no secret was found, using the given name.
|
9 | 8 | /// </summary>
|
10 |
| - [Serializable] |
11 | 9 | public class SecretNotFoundException : Exception
|
12 | 10 | {
|
13 | 11 | /// <summary>
|
@@ -40,34 +38,9 @@ public SecretNotFoundException(string name, Exception innerException) : base($"T
|
40 | 38 | Name = name;
|
41 | 39 | }
|
42 | 40 |
|
43 |
| - /// <summary> |
44 |
| - /// Creates <see cref="SecretNotFoundException"/> used for serialization. |
45 |
| - /// </summary> |
46 |
| - /// <param name="info">The <see cref="T:SerializationInfo"></see> that holds the serialized object data about the exception being thrown.</param> |
47 |
| - /// <param name="context">The <see cref="T:StreamingContext"></see> that contains contextual information about the source or destination.</param> |
48 |
| - /// <exception cref="ArgumentNullException">The info must not be <c>null</c>.</exception> |
49 |
| - /// <exception cref="SerializationException">The class name must not be <c>null</c> and <see cref="Exception.HResult"/> must not be zero (<c>0</c>).</exception> |
50 |
| - protected SecretNotFoundException(SerializationInfo info, StreamingContext context) : base(info, context) |
51 |
| - { |
52 |
| - Name = info.GetString(nameof(Name)); |
53 |
| - } |
54 |
| - |
55 | 41 | /// <summary>
|
56 | 42 | /// Name of the missing key
|
57 | 43 | /// </summary>
|
58 | 44 | public string Name { get; } = "undefined";
|
59 |
| - |
60 |
| - /// <summary> |
61 |
| - /// When overridden in a derived class, sets the <see cref="T:SerializationInfo"></see> with information about the exception. |
62 |
| - /// </summary> |
63 |
| - /// <param name="info">The <see cref="T:SerializationInfo"></see> that holds the serialized object data about the exception being thrown.</param> |
64 |
| - /// <param name="context">The <see cref="T:StreamingContext"></see> that contains contextual information about the source or destination.</param> |
65 |
| - /// <exception cref="T:ArgumentNullException">The <paramref name="info">info</paramref> parameter is a null reference (Nothing in Visual Basic).</exception> |
66 |
| - public override void GetObjectData(SerializationInfo info, StreamingContext context) |
67 |
| - { |
68 |
| - base.GetObjectData(info, context); |
69 |
| - |
70 |
| - info.AddValue(nameof(Name), Name); |
71 |
| - } |
72 | 45 | }
|
73 | 46 | }
|
0 commit comments