Skip to content

Commit 2436911

Browse files
committed
Improve unexpected exception reporting
1 parent 5ed1dac commit 2436911

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

ogc/bblocks/validation/json_.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import json
2+
import os
23
import random
4+
import sys
35
import traceback
46
from json import JSONDecodeError
57
from pathlib import Path
@@ -192,6 +194,9 @@ def validate(self, filename: Path, output_filename: Path, report: ValidationRepo
192194
))
193195
except Exception as e:
194196
if not isinstance(e, jsonschema.exceptions.ValidationError):
197+
print(f'Unexpected error encountered when validating '
198+
f'resource {os.path.relpath(filename)} for {self.bblock}:',
199+
file=sys.stderr)
195200
traceback.print_exception(e)
196201
report.add_entry(ValidationReportEntry(
197202
section=ValidationReportSection.JSON_SCHEMA,

0 commit comments

Comments
 (0)