CiviMRF / CMRF_Abstract_Core

Abstract implementation for the the CMRF Core. Should be included into the concrete module implementation
GNU Affero General Public License v3.0
1 stars 4 forks source link

`error_code` not passed to reply when catching exception in executeCall() #4

Open jensschuppe opened 6 years ago

jensschuppe commented 6 years ago

At least for the local connector (cURL not checked), when doing

$call->setStatus(Call::STATUS_FAILED, $e->getMessage());

CiviCRM's error_message is not passed through and is thus not available within the call's reply property. At least for the local connector, only CiviCRM_API3_Exceptions should be caught, and their error code be passed using

$call->setStatus(Call::STATUS_FAILED, $e->getMessage(), $e->getErrorCode());