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

Better json_decode exception handling #883

Merged
merged 1 commit into from
Dec 1, 2023

Conversation

Pilskalns
Copy link
Contributor

Wrap json_decode in proper handling for strict syntax checks.

Fixes #882

@wintrue
Copy link

wintrue commented Dec 1, 2023

There are still mistakes.

@wintrue
Copy link

wintrue commented Dec 1, 2023

string(102) "{"id":"20231201095056.bb2a8c9f645a8ef7@xxx.com.hk","message":"Queued. Thank you."}
"
^ Mailgun\Exception\HydrationException {#122
#message: "Error (4) when trying to json_decode response"
#code: 0
#file: "/var/www/server/shawprize/server/vendor/mailgun/mailgun-php/src/Hydrator/ModelHydrator.php"
#line: 42
trace: {
/var/www/server/shawprize/server/vendor/mailgun/mailgun-php/src/Hydrator/ModelHydrator.php:42 {}
/var/www/server/shawprize/server/vendor/mailgun/mailgun-php/src/Api/HttpApi.php:79 {}
/var/www/server/shawprize/server/vendor/mailgun/mailgun-php/src/Api/Message.php:77 {}
/var/www/server/shawprize/server/app/common/service/ExtHelperService.php:131 {
app\common\service\ExtHelperService::sendMail($address, $subject, $body) …
› # Make the call to the client.
› $result= $mgClient->messages()->send($domain, $params);

@oleksandr-mykhailenko oleksandr-mykhailenko merged commit 3dbdc2f into mailgun:master Dec 1, 2023
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.

Bug: Proper json_last_error() handling with try catch
3 participants