Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(#82): handle errors responses with a single Error #86

Merged
merged 3 commits into from
Dec 10, 2023

Conversation

annuh
Copy link
Contributor

@annuh annuh commented Dec 10, 2023

Fixes #82

This PR improves handling HTTP 400 errors with a single Error.

Documentation PostNL API: https://docs.api.postnl.nl/#tag/Locations/paths/~1shipment~1v2_1~1locations~1nearest/get:

// Response 400
{
  "Date": "2019-08-24T14:15:22Z",
  "Error": {
    "ErrorCode": "3000",
    "ErrorDescription": "Request format is invalid"
  },
  "RequestId": "09fd61fe-0099-4349-b71d-dce5c2472be9"
}

Copy link

codecov bot commented Dec 10, 2023

Codecov Report

Merging #86 (292b3ae) into v2.0.x (91748ef) will not change coverage.
The diff coverage is 100.00%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##             v2.0.x      #86   +/-   ##
=========================================
  Coverage     69.05%   69.05%           
- Complexity     2209     2210    +1     
=========================================
  Files           124      124           
  Lines          6427     6427           
=========================================
  Hits           4438     4438           
  Misses         1989     1989           
Files Coverage Δ
...seProcessor/Rest/AbstractRestResponseProcessor.php 56.92% <100.00%> (+1.36%) ⬆️

... and 2 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 91748ef...292b3ae. Read the comment docs.

@annuh annuh marked this pull request as ready for review December 10, 2023 12:39
@annuh annuh changed the title fix(#82): handle Error responses (HTTP 400) fix(#82): handle errors responses with a single Error Dec 10, 2023
@firstred
Copy link
Owner

Thanks a lot!

@firstred firstred merged commit 9bdbea2 into firstred:v2.0.x Dec 10, 2023
7 checks passed
@annuh
Copy link
Contributor Author

annuh commented Dec 10, 2023

Thanks for the quick review!
Is it possible to create a new release that contains this, and the other fixes? 🙂

@firstred
Copy link
Owner

Sure thing! Just checking the v1.4.x branch as well and see if both'll work on PHP 8.3. If everything is fine, I'll make a new release.

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.

Error Deserializable entity GetNearestLocationsResponse contains unknown properties
2 participants