-
Notifications
You must be signed in to change notification settings - Fork 892
/
Copy pathNativeException.cs
49 lines (42 loc) · 1.2 KB
/
NativeException.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
using System;
#if NETFRAMEWORK
using System.Runtime.Serialization;
#endif
using LibGit2Sharp.Core;
namespace LibGit2Sharp
{
/// <summary>
/// An exception thrown that corresponds to a libgit2 (native library) error.
/// </summary>
#if NETFRAMEWORK
[Serializable]
#endif
public abstract class NativeException : LibGit2SharpException
{
/// <summary>
/// Needed for mocking purposes.
/// </summary>
protected NativeException()
{ }
internal NativeException(string message)
: base(message)
{ }
internal NativeException(string message, Exception innerException)
: base(message, innerException)
{ }
internal NativeException(string format, params object[] args)
: base(format, args)
{
}
#if NETFRAMEWORK
internal NativeException(SerializationInfo info, StreamingContext context)
: base(info, context)
{ }
#endif
internal NativeException(string message, GitErrorCategory category) : this(message)
{
Data.Add("libgit2.category", (int)category);
}
internal abstract GitErrorCode ErrorCode { get; }
}
}