pepkit / pephubclient

A tool to provide Python and CLI interface and Python API for PEPhub.
https://pephub.databio.org
BSD 2-Clause "Simplified" License
3 stars 0 forks source link

Please improve the error message if I provide a bad registry path #46

Open nsheff opened 2 months ago

nsheff commented 2 months ago

I gave a bad registry path to see what it would do.

Looper version: 2.0.0a1
Command: run
Using looper config (.looper.yaml).
Traceback (most recent call last):
  File "/home/nsheff/.local/bin/looper", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/home/nsheff/.local/lib/python3.12/site-packages/looper/cli_pydantic.py", line 352, in main
    return run_looper(args, parser, test_args=test_args)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/nsheff/.local/lib/python3.12/site-packages/looper/cli_pydantic.py", line 221, in run_looper
    project_dict=PEPHubClient()._load_raw_pep(
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/typing_extensions.py", line 2673, in wrapper
    return arg(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^
  File "/home/nsheff/.local/lib/python3.12/site-packages/pephubclient/pephubclient.py", line 272, in _load_raw_pep
    return self.load_raw_pep(registry_path, query_param)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/nsheff/.local/lib/python3.12/site-packages/pephubclient/pephubclient.py", line 304, in load_raw_pep
    raise ResponseError("File does not exist, or you are unauthorized.")
pephubclient.exceptions.ResponseError: File does not exist, or you are unauthorized.

In fact this is not a File, so this is a wrong error message.

It should say something like:

No PEP found at provided registery path: 'xyz/bogus_path:tag'

Importantly: it should state the registry path that was bad.