Replies: 2 comments
-
|
@bencroker Which gateway is storing such a long error message? The message should be human readable, so not super long, and the full response (which would also contain the error) should be stored in the transaction response. |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
Some error messages contain validation errors which span multiple lines, for example: {
"errorName": "bodyDoesNotMatchSchema",
"message": "The json body provided does not match the expected schema",
"validationErrors": [
{
"errorName": "fieldMustBeNumber",
"message": "Field at path must be a number",
"jsonPath": "$.amount"
},
{
"errorName": "fieldIsMissing",
"message": "Field at path must be present",
"jsonPath": "$.description"
},
{
"errorName": "fieldHasInvalidValue",
"message": "Payment Instrument type must be card/wallet",
"jsonPath": "$.paymentInstrument.type"
}
]
} |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
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:
the full response can be stored:
Beta Was this translation helpful? Give feedback.
All reactions