improve error handling

This commit is contained in:
2023-07-11 10:32:06 +10:00
parent 36f31fa0fc
commit 5c4f9029eb

View File

@@ -236,7 +236,9 @@ function booking_stripe_validate_form_payment($form, &$form_state) {
drupal_set_message($e->getMessage(), 'error');
}
catch (\Stripe\Exception\CardException $e) {
watchdog('booking', $e->getMessage());
$e_json = $e->getJsonBody();
watchdog('booking', "Detected exception processing Stripe payment : !message . !error",
array('!message' => $e->getMessage(), '!error' => $e_json['error']));
drupal_set_message($e->getMessage(), 'error');
}
}