Skip to content

Conversation

@st31ny
Copy link
Collaborator

@st31ny st31ny commented Nov 15, 2019

KeyError and TypeError are very generic and might point to an error in
the method implementation rather than in the client. The new exceptions
MethodNotFoundError and InvalidArgumentsError avoid these issues, so
there is no need to catch the generic ones anymore. This effectively
changes method behavior if methods raise KeyErrors and/or TypeErrors.

As pointed out previously, it is debatable whether to keep catching AssertionErrors as they can be used to check simple server invariants rather than method arguments, too.

KeyError and TypeError are very generic and might point to an error in the method implementation rather than in the client. The new exceptions MethodNotFoundError and InvalidArgumentsError avoid these issues, so there is no need to catch the generic ones anymore. This effectively changes method behavior if methods raise KeyErrors and/or TypeErrors.
@bcb bcb merged commit a15dd87 into explodinglabs:5.0 Nov 15, 2019
@bcb bcb added this to the Version 5 milestone Nov 16, 2019
@bcb
Copy link
Member

bcb commented Nov 16, 2019

Actually have removed KeyError in 4.1.0, because it wasn't part of the library's api so it's not a breaking change.

@st31ny
Copy link
Collaborator Author

st31ny commented Nov 18, 2019

Ok, even better!

@st31ny st31ny deleted the remove_legacy_exceptions branch November 18, 2019 16:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants