Skip to content

Commit b4bc8e9

Browse files
Ghesselinkaothms
authored andcommitted
dump collected validation errors
1 parent af89a94 commit b4bc8e9

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

__main__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import sys
22
import json
33
import argparse
4-
from . import parse, ValidationError
4+
from . import parse, CollectedValidationErrors
55

66
def main():
77
parser = argparse.ArgumentParser(description="Parse and validate STEP file.")
@@ -22,11 +22,11 @@ def main():
2222
if not args.json:
2323
print("Valid", file=sys.stderr)
2424
exit(0)
25-
except ValidationError as exc:
25+
except CollectedValidationErrors as exc:
2626
if not args.json:
2727
print(exc, file=sys.stderr)
2828
else:
29-
json.dump([e.asdict() for e in getattr(exc, "errors", [exc])], sys.stdout, indent=2)
29+
json.dump([e.asdict() for e in exc.errors], sys.stdout, indent=2)
3030
exit(1)
3131

3232
if __name__ == '__main__':

0 commit comments

Comments
 (0)