I find the StripeApiService::call method quite handy because of the built-in logging. However I would like to be able to also catch execeptions on my code so I can act accordingly insetad of just relying on null checking which provide very little information.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

esclapes created an issue. See original summary.

esclapes’s picture

Status: Active » Needs review
FileSize
2.38 KB

Here is a patch that uses a second method with an extra parameter for whether on not to re-throw. I did not want to change the signature of the call method, so I moved the logic to the new one.

welly’s picture

Version: 8.x-1.x-dev » 7.x-1.x-dev
FileSize
727 bytes

Thanks for this, I've created a D7 backport of your patch which works very well.

sean_e_dietrich’s picture

Patch #2 cannot be applied to the recent dev version and fails when being applied. Rerolled the patch to work with the latest version of the dev branch.

sean_e_dietrich’s picture

I actually realized that now after uploading the previous patch it was incorrect as it called the wrong variable names. Modified patch to use the correct variables.