Log exceptions rather than swallow them

Open
#96 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
48/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
python
Domain
cli

Research direction

Start in src/kup/main.py at the exception handler for kup push around lines 781–783. Inspect how failures are handled and whether similar handlers swallow exception details. Done means exception messages are available at debug level while the default user-facing output remains unchanged.

Written by the indexing model from the issue text.

Description

Sometimes we would like to see the raw error messages when a kup command fails. This is very useful on CI, but I do agree that we'd really want to hide that from the users by default.

I propose we log the messages of exceptions at debug level, for example here in the implementation of kup push:

    except Exception as e:
        rich.print('❗ [red]Could not push binaries to cachix!')
        logger.debug(e.msg) # we should add this
        sys.exit(1)
Dominant language
Python
Stars
10
Forks
2
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from runtimeverification/kup

All issues in runtimeverification/kup

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.