mecachisenros / woocommerce_civicrm

GNU Affero General Public License v3.0
14 stars 16 forks source link

CiviCRM API3 exceptions not caught #17

Closed mjwright closed 5 years ago

mjwright commented 6 years ago

Exceptions to all civicrm_api3 calls are not caught. API3 exceptions throw CiviCRM_API3_Exception, but this plugin only catches CiviCRM_Exception. Need to change all catches to CiviCRM_API3_Exception.

This is noticeable when the user attempts to change their Billing Address through the WooCommerce My Account Billing Address page when there is no Billing Address in CiviCRM resulting in: PHP Fatal error: Uncaught CiviCRM_API3_Exception: [undefined: Expected one Address but found 0

mecachisenros commented 6 years ago

@mjwright that's been address in v2.1 in my fork, which also removes the need of the CiviCRM extension.

I haven't submitted a PR as I haven't tested it fully, so if you do try v2.1 do it in a dev environment.

mecachisenros commented 5 years ago

@mjwright this should be addressed in the current master branch.