-
Notifications
You must be signed in to change notification settings - Fork 275
Expand file tree
/
Copy pathOpenApiException.cs
More file actions
51 lines (46 loc) · 2.09 KB
/
OpenApiException.cs
File metadata and controls
51 lines (46 loc) · 2.09 KB
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
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.
using System;
using Microsoft.OpenApi.Properties;
namespace Microsoft.OpenApi.Exceptions
{
/// <summary>
/// Exception type representing exceptions in the Open API library.
/// </summary>
public class OpenApiException : Exception
{
/// <summary>
/// Creates a new instance of the <see cref="OpenApiException"/> class with default values.
/// </summary>
public OpenApiException()
: this(SRResource.OpenApiExceptionGenericError)
{
}
/// <summary>
/// Creates a new instance of the <see cref="OpenApiException"/> class with an error message.
/// </summary>
/// <param name="message">The plain text error message for this exception.</param>
public OpenApiException(string message)
: this(message, null)
{
}
/// <summary>
/// Creates a new instance of the <see cref="OpenApiException"/> class with an error message and an inner exception.
/// </summary>
/// <param name="message">The plain text error message for this exception.</param>
/// <param name="innerException">The inner exception that is the cause of this exception to be thrown.</param>
public OpenApiException(string message, Exception? innerException)
: base(message, innerException)
{
}
/// <summary>
/// The reference pointer. This is a fragment identifier used to point to where the error occurred in the document.
/// If the document has been parsed as JSON/YAML then the identifier will be a
/// JSON Pointer as per https://tools.ietf.org/html/rfc6901
/// If the document fails to parse as JSON/YAML then the fragment will be based on
/// a text/plain pointer as defined in https://tools.ietf.org/html/rfc5147
/// Currently only line= is provided because using char= causes tests to break due to CR/LF and LF differences
/// </summary>
public string? Pointer { get; set; }
}
}