@@ -26,7 +26,7 @@ public MapNode CheckMapNode(string nodeName)
26
26
{
27
27
if ( ! ( this is MapNode mapNode ) )
28
28
{
29
- throw new OpenApiReaderException ( $ "{ nodeName } must be a map/object") ;
29
+ throw new OpenApiReaderException ( $ "{ nodeName } must be a map/object", Context ) ;
30
30
}
31
31
32
32
return mapNode ;
@@ -50,51 +50,50 @@ public static ParseNode Create(ParsingContext context, YamlNode node)
50
50
51
51
public virtual List < T > CreateList < T > ( Func < MapNode , T > map )
52
52
{
53
- throw new OpenApiReaderException ( "Cannot create list from this type of node." ) ;
53
+ throw new OpenApiReaderException ( "Cannot create list from this type of node." , Context ) ;
54
54
}
55
55
56
56
public virtual Dictionary < string , T > CreateMap < T > ( Func < MapNode , T > map )
57
57
{
58
- throw new OpenApiReaderException ( "Cannot create map from this type of node." ) ;
58
+ throw new OpenApiReaderException ( "Cannot create map from this type of node." , Context ) ;
59
59
}
60
60
61
61
public virtual Dictionary < string , T > CreateMapWithReference < T > (
62
62
ReferenceType referenceType ,
63
63
Func < MapNode , T > map )
64
64
where T : class , IOpenApiReferenceable
65
65
{
66
- throw new OpenApiReaderException ( "Cannot create map from this reference." ) ;
66
+ throw new OpenApiReaderException ( "Cannot create map from this reference." , Context ) ;
67
67
}
68
68
69
69
public virtual List < T > CreateSimpleList < T > ( Func < ValueNode , T > map )
70
70
{
71
- throw new OpenApiReaderException ( "Cannot create simple list from this type of node." ) ;
71
+ throw new OpenApiReaderException ( "Cannot create simple list from this type of node." , Context ) ;
72
72
}
73
73
74
74
public virtual Dictionary < string , T > CreateSimpleMap < T > ( Func < ValueNode , T > map )
75
75
{
76
- throw new OpenApiReaderException ( "Cannot create simple map from this type of node." ) ;
76
+ throw new OpenApiReaderException ( "Cannot create simple map from this type of node." , Context ) ;
77
77
}
78
78
79
79
public virtual IOpenApiAny CreateAny ( )
80
80
{
81
- throw new OpenApiReaderException ( "Cannot create an Any object this type of node." ) ;
81
+ throw new OpenApiReaderException ( "Cannot create an Any object this type of node." , Context ) ;
82
82
}
83
83
84
84
public virtual string GetRaw ( )
85
85
{
86
- throw new OpenApiReaderException ( "Cannot get raw value from this type of node." ) ;
86
+ throw new OpenApiReaderException ( "Cannot get raw value from this type of node." , Context ) ;
87
87
}
88
88
89
89
public virtual string GetScalarValue ( )
90
90
{
91
- throw new OpenApiReaderException ( "Cannot create a scalar value from this type of node." ) ;
91
+ throw new OpenApiReaderException ( "Cannot create a scalar value from this type of node." , Context ) ;
92
92
}
93
93
94
94
public virtual List < IOpenApiAny > CreateListOfAny ( )
95
95
{
96
- throw new OpenApiReaderException ( "Cannot create a list from this type of node." ) ;
96
+ throw new OpenApiReaderException ( "Cannot create a list from this type of node." , Context ) ;
97
97
}
98
-
99
98
}
100
99
}
0 commit comments