-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathExceptions.cs
More file actions
24 lines (22 loc) · 850 Bytes
/
Exceptions.cs
File metadata and controls
24 lines (22 loc) · 850 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
using System;
namespace HarmonyInjector
{
/// <summary>
/// Special exception thrown when injection fails.
/// </summary>
public sealed class InjectionException : Exception
{
public InjectionException(string message) : base(message) { }
public InjectionException(string message, Exception innerException) : base(message, innerException) { }
}
/// <summary>
/// Special exception thrown when a static constructor throws.
/// </summary>
public sealed class StaticInitializationException : InvalidOperationException
{
public Type TargetType { get; private set; }
public StaticInitializationException(Type type, Exception innerException) :
base($"The static constructor of `{type.FullName}` raised an exception.", innerException)
{ TargetType = type; }
}
}