-
-
Notifications
You must be signed in to change notification settings - Fork 143
Expand file tree
/
Copy pathInnerError.cs
More file actions
71 lines (60 loc) · 2.51 KB
/
Copy pathInnerError.cs
File metadata and controls
71 lines (60 loc) · 2.51 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 Exceptionless.Models.Data {
public class InnerError : IData {
public InnerError() {
Data = new DataDictionary();
StackTrace = new StackFrameCollection();
}
/// <summary>
/// The error message.
/// </summary>
public string Message { get; set; }
/// <summary>
/// The error type.
/// </summary>
public string Type { get; set; }
/// <summary>
/// The error code.
/// </summary>
public string Code { get; set; }
/// <summary>
/// Extended data entries for this error.
/// </summary>
public DataDictionary Data { get; set; }
/// <summary>
/// An inner (nested) error.
/// </summary>
public InnerError Inner { get; set; }
/// <summary>
/// The stack trace for the error.
/// </summary>
public StackFrameCollection StackTrace { get; set; }
/// <summary>
/// The target method.
/// </summary>
public Method TargetMethod { get; set; }
protected bool Equals(InnerError other) {
return string.Equals(Message, other.Message) && string.Equals(Type, other.Type) && string.Equals(Code, other.Code) && Equals(Data, other.Data) && Equals(Inner, other.Inner) && StackTrace.CollectionEquals(other.StackTrace) && Equals(TargetMethod, other.TargetMethod);
}
public override bool Equals(object obj) {
if (ReferenceEquals(null, obj))
return false;
if (ReferenceEquals(this, obj))
return true;
if (obj.GetType() != this.GetType())
return false;
return Equals((InnerError)obj);
}
public override int GetHashCode() {
unchecked {
var hashCode = Message == null ? 0 : Message.GetHashCode();
hashCode = (hashCode * 397) ^ (Type == null ? 0 : Type.GetHashCode());
hashCode = (hashCode * 397) ^ (Code == null ? 0 : Code.GetHashCode());
hashCode = (hashCode * 397) ^ (Data == null ? 0 : Data.GetCollectionHashCode());
hashCode = (hashCode * 397) ^ (Inner == null ? 0 : Inner.GetHashCode());
hashCode = (hashCode * 397) ^ (StackTrace == null ? 0 : StackTrace.GetCollectionHashCode());
hashCode = (hashCode * 397) ^ (TargetMethod == null ? 0 : TargetMethod.GetHashCode());
return hashCode;
}
}
}
}