Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: inherit CommandError (also) from subprocess.CalledProcessError #50

Closed
wants to merge 1 commit into from

Commits on Oct 1, 2024

  1. feat: inherit CommandError (also) from subprocess.CalledProcessError

    In the DataLad world `CommandError` was traditionally a `RuntimeError`.
    Whether or not that makes sense in the general case, one can have
    different opinions about.
    
    The rest of the world is using `subprocess.CalledProcessError`. This
    exception type is very similar to `CommandError` in the properties
    that it can capture. It is only missing the CWD info, and the
    context message that comes with `RuntimeError` (see class docs).
    
    This change connects the two worlds, by inheriting from both
    `RuntimeError` and `CalledProcessError`, and using the properties
    of both, where possible.
    
    The behavior of `CommandError` remains unchanged, but it will now also
    work with code that expects a `subprocess` exception.
    mih committed Oct 1, 2024
    Configuration menu
    Copy the full SHA
    f167ef7 View commit details
    Browse the repository at this point in the history