- Issue created by @Anybody
- 🇩🇪Germany Anybody Porta Westfalica
Seems this has once been reported in the past: 🐛 Error log message gets truncated Closed: duplicate
The latest release is younger, so there still seem to be places where this needs to be improved. Root cause is the same: Guzzle hard-coded limit: https://github.com/guzzle/guzzle/issues/2185
Also see
- 🇩🇪Germany Anybody Porta Westfalica
Looks like same should be done for all
BadResponseException
's?In my case, it was
} catch (BadResponseException $exception) { // Log untrimmed exception: throw new PaymentGatewayException($exception->getResponse()->getBody()->getContents(), 0, $exception); }
caused by
$response = $sdk->captureOrder($remote_id);
throwing an exception in/src/Plugin/Commerce/PaymentGateway/Checkout.php
- Merge request !36Log complete error message on BadResponseExceptions, not truncated Guzzle message. → (Open) created by Anybody
- 🇩🇪Germany Anybody Porta Westfalica
@jacksacksick: Or would you prefer this central solution: https://akrabat.com/increase-truncated-body-in-a-guzzle-exception ?
Then we could probably switch back to$e->getMessage()
entirely. - 🇮🇱Israel jsacksick
Ok I think we need to call the
hasResponse()
method first, or add a failsafe. I think we should log the response only if present, otherwise fallback to the exception message.Something like:
if ($exception->hasResponse()) { ... }
- 🇩🇪Germany Anybody Porta Westfalica
Good point, thank you @jsacksick we'll add that. Also for the already existing calls then, I think?
- First commit to issue fork.
- 🇩🇪Germany Anybody Porta Westfalica
Some left from previous existing code:
- src/Plugin/Commerce/PaymentGateway/Checkout.php (Several)
- src/Plugin/Commerce/PaymentGateway/PayflowLink.php