-
Notifications
You must be signed in to change notification settings - Fork 138
/
MissingActionTypeException.cs
33 lines (31 loc) · 1.14 KB
/
MissingActionTypeException.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
using System;
namespace Libplanet.Action
{
/// <summary>
/// The exception that is thrown when an action class without
/// <see cref="ActionTypeAttribute"/> is tried to used with
/// <see cref="PolymorphicAction{T}"/>.
/// </summary>
/// <seealso cref="PolymorphicAction{T}"/>
[Serializable]
public sealed class MissingActionTypeException : Exception
{
/// <summary>
/// Creates a new <see cref="MissingActionTypeException"/> object.
/// </summary>
/// <param name="actionType">The action type that lacks
/// <see cref="ActionTypeAttribute"/>. It is automatically included to
/// the <see cref="Exception.Message"/> string.</param>
/// <param name="message">Specifies an <see cref="Exception.Message"/>.
/// </param>
public MissingActionTypeException(Type actionType, string message)
: base($"{actionType}: {message}")
{
ActionType = actionType;
}
/// <summary>
/// The action type that lacks <see cref="ActionTypeAttribute"/>.
/// </summary>
public Type ActionType { get; }
}
}