Skip to content

Add clear error message when pipper.json has the wrong format or library doesn't exist #7

@rigogsilva

Description

@rigogsilva

This is the error I got when I left the pipper.json empty.

A good feature request would be to add an error message like: invalid pipper.json and also Requested library not found: foo.

Traceback (most recent call last):
  File "/usr/local/bin/pipper", line 11, in <module>
    sys.exit(run())
  File "/usr/local/lib/python3.6/site-packages/pipper/command.py", line 63, in run
    action(env)
  File "/usr/local/lib/python3.6/site-packages/pipper/installer.py", line 182, in run
    install_from_configs(env, env.args.get('configs_path'))
  File "/usr/local/lib/python3.6/site-packages/pipper/installer.py", line 161, in install_from_configs
    configs = environment.load_configs(configs_path)
  File "/usr/local/lib/python3.6/site-packages/pipper/environment.py", line 119, in load_configs
    return json.load(f)
  File "/usr/local/lib/python3.6/json/__init__.py", line 299, in load
    parse_constant=parse_constant, object_pairs_hook=object_pairs_hook, **kw)
  File "/usr/local/lib/python3.6/json/__init__.py", line 354, in loads
    return _default_decoder.decode(s)
  File "/usr/local/lib/python3.6/json/decoder.py", line 339, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/local/lib/python3.6/json/decoder.py", line 357, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions