forked from alpacahq/alpaca-trade-api-csharp
/
RequestValidationException.cs
67 lines (61 loc) · 2.08 KB
/
RequestValidationException.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
namespace Alpaca.Markets;
/// <summary>
/// Represents exception information for request input data validation errors.
/// </summary>
[Serializable]
public sealed class RequestValidationException : Exception
{
/// <summary>
/// Creates new instance of <see cref="RequestValidationException"/> class.
/// </summary>
[ExcludeFromCodeCoverage]
public RequestValidationException()
{
}
/// <summary>
/// Creates new instance of <see cref="RequestValidationException"/> class with specified error message.
/// </summary>
/// <param name="message">The message that describes the error.</param>
[ExcludeFromCodeCoverage]
public RequestValidationException(
String message)
: base(message)
{
}
/// <summary>
/// Creates new instance of <see cref="RequestValidationException"/> class with
/// specified error message and reference to the inner exception that is the cause of this exception.
/// </summary>
/// <param name="message">The message that describes the error.</param>
/// <param name="inner">The exception that is the cause of this exception.</param>
[ExcludeFromCodeCoverage]
public RequestValidationException(
String message,
Exception inner)
: base(message, inner)
{
}
/// <summary>
/// Creates new instance of <see cref="RequestValidationException"/> class with specified error message.
/// </summary>
/// <param name="message">The message that describes the error.</param>
/// <param name="propertyName">The invalid property name.</param>
public RequestValidationException(
String message,
String propertyName)
: base(message)
{
PropertyName = propertyName;
}
[ExcludeFromCodeCoverage]
private RequestValidationException(
SerializationInfo info,
StreamingContext context)
: base(info, context)
{
}
/// <summary>
/// Gets the invalid property name that causes this validation exception.
/// </summary>
public String PropertyName { get; } = String.Empty;
}