-
Notifications
You must be signed in to change notification settings - Fork 174
Closed
Labels
Description
What are you trying to do?
When a payment fails, the payment gateway generally returns a long, detailed error message that is stored in Gateway Message. Unfortunately, Guzzle truncates the error message, hiding crucial text and making it difficult to understand why payments are failing.
What's your proposed solution?
Storing the full error message should make troubleshooting errors easier.
Released in version 7.2, guzzle/guzzle#2795 added support for passing a body summarizer to the http errors middleware, which would allow the truncation to be removed (or at the very least increased).
For Guzzle older than 7.2, instead of storing the exception message:
$error = $exception->getMessage();the full response can be stored:
$error = $exception->getResponse()->getBody()->getContents();