1+ /* Copyright 2026 predic8 GmbH, www.predic8.com
2+
3+ Licensed under the Apache License, Version 2.0 (the "License");
4+ you may not use this file except in compliance with the License.
5+ You may obtain a copy of the License at
6+
7+ http://www.apache.org/licenses/LICENSE-2.0
8+
9+ Unless required by applicable law or agreed to in writing, software
10+ distributed under the License is distributed on an "AS IS" BASIS,
11+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+ See the License for the specific language governing permissions and
13+ limitations under the License. */
14+
15+ package com .predic8 .membrane .annot .yaml ;
16+
17+ import com .fasterxml .jackson .core .*;
18+ import com .fasterxml .jackson .databind .*;
19+
20+ import static com .predic8 .membrane .annot .yaml .error .LineYamlErrorRenderer .renderErrorReport ;
21+
22+ public class ConfigurationParsingException extends RuntimeException {
23+
24+ private ParsingContext <?> parsingContext ;
25+ private JsonNode wrong ;
26+
27+ public ConfigurationParsingException (String message ) {
28+ super (message );
29+ }
30+
31+ public ConfigurationParsingException (Throwable cause ) {
32+ super (cause );
33+ }
34+
35+ public ConfigurationParsingException (String message , Throwable cause , ParsingContext <?> pc ) {
36+ super (message , cause );
37+ this .parsingContext = pc ;
38+ }
39+
40+ public ParsingContext <?> getParsingContext () {
41+ return parsingContext ;
42+ }
43+
44+ public void setParsingContext (ParsingContext <?> parsingContext ) {
45+ this .parsingContext = parsingContext ;
46+ }
47+
48+ /**
49+ * Returns a complete formatted error report including highlighted YAML.
50+ */
51+ public String getFormattedReport () throws JsonProcessingException {
52+ return renderErrorReport (this .parsingContext );
53+ }
54+
55+ public JsonNode getWrong () {
56+ return wrong ;
57+ }
58+
59+ public void setWrong (JsonNode wrong ) {
60+ this .wrong = wrong ;
61+ }
62+ }
0 commit comments