@@ -184,7 +184,7 @@ def parse_args(args):
184
184
def make_validator (schema_path , validator_class , output_writer ):
185
185
try :
186
186
schema_obj = _load_json_file (schema_path )
187
- except (ValueError , FileNotFoundError ) as exc :
187
+ except (ValueError , IOError ) as exc :
188
188
output_writer .write_parsing_error (schema_path , exc )
189
189
raise exc
190
190
@@ -210,7 +210,7 @@ def load_stdin(stdin, output_writer):
210
210
def load_instance_file (instance_path , output_writer ):
211
211
try :
212
212
instance_obj = _load_json_file (instance_path )
213
- except (ValueError , FileNotFoundError ) as exc :
213
+ except (ValueError , IOError ) as exc :
214
214
output_writer .write_parsing_error (instance_path , exc )
215
215
raise exc
216
216
return instance_obj
@@ -246,7 +246,7 @@ def run(arguments, stdout=sys.stdout, stderr=sys.stderr, stdin=sys.stdin):
246
246
arguments ["validator" ],
247
247
output_writer ,
248
248
)
249
- except (FileNotFoundError , ValueError , SchemaError ):
249
+ except (IOError , ValueError , SchemaError ):
250
250
return False
251
251
252
252
errored = False
@@ -259,7 +259,7 @@ def run(arguments, stdout=sys.stdout, stderr=sys.stderr, stdin=sys.stdin):
259
259
validator ,
260
260
output_writer ,
261
261
)
262
- except (ValueError , FileNotFoundError , ValidationError ):
262
+ except (ValueError , IOError , ValidationError ):
263
263
errored = True
264
264
elif (
265
265
stdin is sys .stdin and not sys .stdin .isatty ()
0 commit comments