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

ServerValidationException throws Exception #26

Closed
JSRM99 opened this issue Feb 5, 2021 · 1 comment · Fixed by #27
Closed

ServerValidationException throws Exception #26

JSRM99 opened this issue Feb 5, 2021 · 1 comment · Fixed by #27
Assignees
Labels
bug Something isn't working

Comments

@JSRM99
Copy link

JSRM99 commented Feb 5, 2021

Trunkrs SDK version(s) affected: 2.0.0
PHP version(s) affected: 7.3.11

Description
The ServerValidationException throws an Exception in the constructor when trying to read the "message" property from the JSON.

How to reproduce
Create a for example a shipment that will make the server return a validation error.

Possible Solution
By the looks of it the correct data to be read is in the "reason" property instead of the "message" one.
Possibly change it to that?

Additional context
Location where exception gets thrown is marked in yellow:
image

@fean fean added the bug Something isn't working label Feb 5, 2021
@fean
Copy link
Contributor

fean commented Feb 5, 2021

Thanks @JSRM99, very good catch! 👍

fean added a commit that referenced this issue Feb 5, 2021
Chlododev added a commit that referenced this issue Feb 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants