clegaspi / saml_reader

A tool to parse and verify SAML response data for MongoDB Cloud.
MIT License
7 stars 2 forks source link

Handle FileNotFoundError for input files #53

Closed clegaspi closed 2 years ago

clegaspi commented 3 years ago

Right now, it appears that if an invalid file name is specified for either the SAML input or the JSON comparison values, we get an ugly error; the former comes from TextReader and the latter from the function in cli.py that opens the JSON file. I thought we configured argparse to handle these files...but maybe not, because argparse likes to send back file handles instead of just the path when you tell it an argument is supposed to be a filename.

Either way, we should handle these errors more gracefully.