Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CSAPI]: Log more details on invalid requests
Previously, just the exception message was logged. For some exceptions, this is quite non-descript, for example: 2024-01-25 06:17:14.061 DEBUG [SWAPool-1] - Invalid request (BAD_PAYLOAD): Invalid payload: Invalid XML: Received event END_DOCUMENT, instead of START_ELEMENT or END_ELEMENT. To solve this error, a backtrace is needed to figure out what was expected exactly. This particular exception message could probably be improved by itself, but this commit solves this more generically, since there might be other exceptions suffering from the same issue. This commit changes the handling of InvalidRequestExceptions to use the existing `logError()` function. This logs details of the request and a backtrace. To ensure that this does not log "Internal server error" but keep the existing "Invalid request", `logError()` is refactored to accept an error prefix.
- Loading branch information