Skip to content

Use ErrorPlugin to raise 4xx and 5xx exceptions#272

Merged
choran merged 1 commit into
masterfrom
ga/raise-4xx-5xx-exceptions
Jan 18, 2019
Merged

Use ErrorPlugin to raise 4xx and 5xx exceptions#272
choran merged 1 commit into
masterfrom
ga/raise-4xx-5xx-exceptions

Conversation

@GabrielAnca

Copy link
Copy Markdown
Contributor

Why?

The release 4.0.0 introduced an unexpected change in exception handling. HTTPlug does not throw exceptions for client/server errors (4xx/5xx) by default and it encourages creating our own exception layer.

How?

As this intends to be a very lightweight API wrapper, we don't want to do that and we expect the exception handling to be done by the library user.

I included the ErrorPlugin so HTTPlug will start throwing exceptions when a 4xx or 5xx error occurs as it used to do in version 3.

@choran choran left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, I find it strange that the default is not to return any errors. I think that is a good catch since otherwise it would be very confusing for people since it is not what they would expect
👍

@choran
choran merged commit 1a52946 into master Jan 18, 2019
@dannyfallon
dannyfallon deleted the ga/raise-4xx-5xx-exceptions branch May 7, 2026 15:16
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