Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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.
- Loading branch information