rackerlabs / lambda-uploader

Helps package and upload Python lambda functions to AWS
Apache License 2.0
270 stars 56 forks source link

more kindly error #159

Open shinriyo opened 6 years ago

shinriyo commented 6 years ago

When we I mistook lambda.json format (ex. like miswrite ,), it tell us what file was mistook.

jarosser06 commented 6 years ago

Currently if I have an invalid JSON file the error message comes back "ValueError: Expecting , delimiter: line 4 column 3 (char 50)" which provides me a reason why the JSON file is not valid.

Your proposed PR only tells us that the configuration file is invalid, not why. I would prefer the error message be more informative than "x" file is bad. Can you rewrite the error to include the original error message as well as what file is incorrect.

Also after testing on my local setup, your PR doesn't appear to work for Python 2.7.

⁉️ Unexpected error. Please report this traceback.
Uploader: 1.3.0
Botocore: 1.4.4
Boto3: 1.5.26

Traceback (most recent call last):
  File "/home/jim/Projects/lambda-uploader/lambda_uploader/shell.py", line 194, in main
    _execute(args)
  File "/home/jim/Projects/lambda-uploader/lambda_uploader/shell.py", line 58, in _execute
    variables=args.variables)
  File "/home/jim/Projects/lambda-uploader/lambda_uploader/config.py", line 47, in __init__
    self._load_config(config_file)
  File "/home/jim/Projects/lambda-uploader/lambda_uploader/config.py", line 199, in _load_config
    except json.decoder.JSONDecodeError: