This repository has been archived by the owner on Aug 30, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathSentryException.cs
68 lines (60 loc) · 2.55 KB
/
SentryException.cs
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
using System.Collections.Generic;
using System.Runtime.Serialization;
// ReSharper disable once CheckNamespace
namespace Sentry.Protocol
{
/// <summary>
/// Sentry Exception interface
/// </summary>
/// <see href="https://docs.sentry.io/clientdev/interfaces/exception/"/>
[DataContract]
public class SentryException
{
// Not serialized since not part of the protocol yet.
// Used by Sentry SDK though to transfer data from Exception.Data to Event.Data when parsing.
internal Dictionary<string, object> InternalData { get; private set; }
/// <summary>
/// Exception Type
/// </summary>
[DataMember(Name = "type", EmitDefaultValue = false)]
public string Type { get; set; }
/// <summary>
/// The exception value
/// </summary>
[DataMember(Name = "value", EmitDefaultValue = false)]
public string Value { get; set; }
/// <summary>
/// The optional module, or package which the exception type lives in
/// </summary>
[DataMember(Name = "module", EmitDefaultValue = false)]
public string Module { get; set; }
/// <summary>
/// An optional value which refers to a thread in the threads interface.
/// </summary>
/// <seealso href="https://docs.sentry.io/clientdev/interfaces/threads/"/>
/// <seealso cref="SentryThread"/>
[DataMember(Name = "thread_id", EmitDefaultValue = false)]
public int ThreadId { get; set; }
/// <summary>
/// Stack trace
/// </summary>
/// <see href="https://docs.sentry.io/clientdev/interfaces/stacktrace/"/>
[DataMember(Name = "stacktrace", EmitDefaultValue = false)]
public SentryStackTrace Stacktrace { get; set; }
/// <summary>
/// An optional mechanism that created this exception.
/// </summary>
/// <see href="https://docs.sentry.io/clientdev/interfaces/mechanism/"/>
[DataMember(Name = "mechanism", EmitDefaultValue = false)]
public Mechanism Mechanism { get; set; }
/// <summary>
/// Arbitrary extra data that related to this error
/// </summary>
/// <remarks>
/// The protocol does not yet support data at this level.
/// For this reason this property is not serialized.
/// The data is moved to the event level on Extra until such support is added
/// </remarks>
public IDictionary<string, object> Data => InternalData ?? (InternalData = new Dictionary<string, object>());
}
}