Skip to content

exception handling #2545

@casperdcl

Description

@casperdcl

There are some instances where I think code is effectively unreachable (unless called in a different way). For example:

https://github.com/iterative/dvc/blob/5c76b46b460e00d3bb5c3f2ea87b19d961491f12/dvc/command/add.py#L17

means that

https://github.com/iterative/dvc/blob/5c76b46b460e00d3bb5c3f2ea87b19d961491f12/dvc/repo/add.py#L22

is never called. Also I feel they should both be raising RecursiveAddingWhileUsingFilename.

Also, the exception above is explicitly caught and the message and type completely suppressed, which seems odd:

https://github.com/iterative/dvc/blob/5c76b46b460e00d3bb5c3f2ea87b19d961491f12/dvc/command/add.py#L27-L29

Surely instead it's better to just let it be raised? If we want to suppress stack trace for user-friendliness, then six.raise_from instead?

Metadata

Metadata

Assignees

Labels

refactoringFactoring and re-factoringuiuser interface / interaction

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions