Skip to content

EnvError should inherit from ValueError#50

Merged
sloria merged 1 commit intosloria:masterfrom
syenchuk:patch-1
Dec 10, 2018
Merged

EnvError should inherit from ValueError#50
sloria merged 1 commit intosloria:masterfrom
syenchuk:patch-1

Conversation

@syenchuk
Copy link
Copy Markdown
Contributor

Hello,

I feel like EnvError should inherit from ValueError instead of the generic Exception.

For instance, env.int of "foo" will raise EnvError, while int("foo") raises ValueError.

It seems to me that both EnvError and ValueError refer to an error inside the value that cannot be safely typecasted. Since ValueError is just a generalization of EnvError, EnvError should inherit from it.

@sloria
Copy link
Copy Markdown
Owner

sloria commented Dec 10, 2018

Makes sense. Thanks!

@sloria sloria merged commit 4d68c32 into sloria:master Dec 10, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants