raashed created FINERACT-3197:
---------------------------------
Summary: Legacy command failure webhooks are sent without status
and response
Key: FINERACT-3197
URL: https://issues.apache.org/jira/browse/FINERACT-3197
Project: Apache Fineract
Issue Type: Bug
Components: System
Reporter: raashed
Problem:
When a command fails in the legacy pipeline,
SynchronousCommandProcessingService.publishHookErrorEvent passes
gson.toJson(errorInfo), a String, to publishHookEvent. publishHookEvent only
adds the failure details when the result is an ErrorInfo, so that branch never
runs. Failure webhooks go out with no status and no response. This dates back
to FINERACT-1744 (5210bf7412).
Passing the ErrorInfo alone isn't enough. A response without an entity
serializes to the JSON literal null, so gson.fromJson returns null and
publishing the webhook fails for those errors.
Proposal:
Pass the ErrorInfo to publishHookEvent, and fall back to an empty map when the
error message parses to null. Failure webhooks then carry status "Exception"
and the error details in response.
Note that this changes the payload of legacy failure webhooks, adding status
and response.
Related: FINERACT-3036, which added failure webhooks for typed commands (PR
#6815).
I'll open a PR for this.
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)