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

errorHandler prints text before throwing error #6

Open
otonielguajardo opened this issue Aug 21, 2024 · 0 comments · May be fixed by #7
Open

errorHandler prints text before throwing error #6

otonielguajardo opened this issue Aug 21, 2024 · 0 comments · May be fixed by #7

Comments

@otonielguajardo
Copy link

otonielguajardo commented Aug 21, 2024

First of all, I'd like to thank the team for your work on this SDK!

So I've been testing and getting expected errors (such as expired sessions, etc.) that I want to handle by displaying custom messages to my users.

The problem is that the SDK's errorHandler prints text before throwing the error.

sync-php/src/sync.php

Lines 99 to 102 in 98ea9dd

echo "-------ERROR-------".PHP_EOL;
print_r($error->get_response());
echo "Code: ".$error->get_code()." Message: ".$error->getMessage().PHP_EOL;
throw $error;

Can we remove this lines? They are conflicting with our code, printing the error directly to the UI. Here's some screenshots of my app and code:

Screenshot 2024-08-21 at 1 02 37 p m

Screenshot 2024-08-21 at 12 59 03 p m

@otonielguajardo otonielguajardo changed the title ErrorHandler prints text that generates conflict errorHandler prints text that generates conflict Aug 21, 2024
@otonielguajardo otonielguajardo changed the title errorHandler prints text that generates conflict errorHandler prints text before throwing the error Aug 21, 2024
@otonielguajardo otonielguajardo changed the title errorHandler prints text before throwing the error errorHandler prints text before throwing error Aug 21, 2024
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 a pull request may close this issue.

1 participant