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

Catch ApiExceptions in ManagesRecords Class #25

Open
papoms opened this issue Dec 1, 2023 · 2 comments
Open

Catch ApiExceptions in ManagesRecords Class #25

papoms opened this issue Dec 1, 2023 · 2 comments

Comments

@papoms
Copy link
Contributor

papoms commented Dec 1, 2023

I've been looking into an issue with the API but did not find any issues in the log (neither the SDK Log nor the Laravel log).
I specifically was looking into authentication issues not being logged when retrieving records like so:

 $manager = ZohoManager::make('Deals');
 $record =  $manager->getRecord($id);

To reproduce:

  • edit storage/app/zoho/oauth/tokens/zcrm_oauthtokens.txt so the access_token is wrong and run the above code.
  • The Authentication will fail but ManagesRecords.php will not catch the error and log it.

For me it boils down to this line

Suggested Fix
use com\zoho\crm\api\modules\APIException;
should be
use com\zoho\crm\api\record\APIException;

Or is there a specific reason to use modules i am missing?

@papoms
Copy link
Contributor Author

papoms commented Dec 1, 2023

Happy to provide a PR. Or do we need to catch both types of Exceptions here?

@papoms
Copy link
Contributor Author

papoms commented Dec 1, 2023

This is what i am trying out now:
papoms@5bc41c9

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

No branches or pull requests

1 participant