Skip to content

Stop truncating error messages #1901

@bencroker

Description

@bencroker

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();

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions