improve error message
This commit is contained in:
parent
6085239f69
commit
498dc9523f
2 changed files with 8 additions and 4 deletions
|
@ -57,7 +57,13 @@ function civicrm_api3_twingle_form_Create(array $params): array {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Re-create TwingleProject
|
// Re-create TwingleProject
|
||||||
|
try {
|
||||||
$result = civicrm_api3('TwingleProject', 'create', $params);
|
$result = civicrm_api3('TwingleProject', 'create', $params);
|
||||||
|
} catch (CiviCRM_API3_Exception $e) {
|
||||||
|
$extraParams = $e->getExtraParams();
|
||||||
|
unset($extraParams['error_code']);
|
||||||
|
return civicrm_api3_create_error($e->getMessage(), $extraParams);
|
||||||
|
}
|
||||||
|
|
||||||
// Retrun results
|
// Retrun results
|
||||||
if ($result['is_error'] != 1) {
|
if ($result['is_error'] != 1) {
|
||||||
|
|
|
@ -96,9 +96,7 @@ function civicrm_api3_twingle_project_Create(array $params): array {
|
||||||
$project = new TwingleProject($params, $id);
|
$project = new TwingleProject($params, $id);
|
||||||
}
|
}
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
return civicrm_api3_create_error(
|
return civicrm_api3_create_error($e->getMessage(), $params);
|
||||||
'Could not instantiate TwingleProject: ' . $e->getMessage()
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue