-
Notifications
You must be signed in to change notification settings - Fork 23
Handle response errors #158
Handle response errors #158
Conversation
d258be3 to
d2d826f
Compare
|
So, first of all thanks and I do agree that error handling is currently not in great shape. the code that you added is mostly sitting on top of the expected json/array structure - which is a valid addition, but i doesn't help with 4xx/5xx situations, since everything is converted to a runtime exception and context of the original error or unexpected behavior would get lost. i consider the structural changes that you check and error handling with RuntimeException a valuable addition, but would still keep the this was the original handling, which is broken since i introduced the |
chr-hertel
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's focus on the additional RuntimeExceptions - they are a good addition and provide value. Thanks for that!
b5c8506 to
e20eda1
Compare
e20eda1 to
1fb7102
Compare
|
Thank you for your review and your feedbacks @chr-hertel. I applied your suggestions |
chr-hertel
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @Iyadhfaleh
I think json_decode is better to handle responses APIs .
"toArray" method will throw exception when status code >= 300 .