Skip to content

Add more helpful error messages for KeyError #158

@caizixian

Description

@caizixian
[INFO] 2024-08-06 06:29:57,770 minheap.py:190 Temporary directory: /tmp/minheap-9i51vtq5
Traceback (most recent call last):
  File "/usr/local/bin/running", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.10/dist-packages/running/__main__.py", line 50, in main
    if m.run(args):
  File "/usr/local/lib/python3.10/dist-packages/running/command/minheap.py", line 192, in run
    run_with_persistence(result, Path(minheap_dir), None, attempts)
  File "/usr/local/lib/python3.10/dist-packages/running/command/minheap.py", line 115, in run_with_persistence
    runtime, mods = parse_config_str(configuration, c)
  File "/usr/local/lib/python3.10/dist-packages/running/util.py", line 68, in parse_config_str
    runtime = configuration.get("runtimes")[c.split("|")[0].strip()]
KeyError: 'jdk21'

Should tell the user which part of the config that the lookup happened.

Metadata

Metadata

Assignees

No one assigned

    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