Skip to content

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

@nsheff

Description

@nsheff

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.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions