Skip to content

Commit

Permalink
Merge pull request #1271 from adorsys/1270-failing-with-400-bad-request
Browse files Browse the repository at this point in the history
Improve error logging for Keycloak responses
  • Loading branch information
Motouom authored Feb 12, 2025
2 parents cf6a9eb + 5681f80 commit 1977131
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
## [Unreleased]

## [6.3.0] - 2025-02-03
### Added
- Improve error logging for Keycloak responses [1270](https://github.com/adorsys/keycloak-config-cli/issues/1270)

### Fixed
- Fix high level CVE (CVE-2024-38807)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,15 @@ public void run(String... args) {
} catch (NullPointerException e) {
throw e;
} catch (Exception e) {
logger.error(e.getMessage());
logger.error("Error during Keycloak import: {}", e.getMessage(), e);
if (e.getCause() instanceof Exception cause) {
try {
String responseBody = cause.toString();
logger.error("Error Response: {}", responseBody);
} catch (Exception ex) {
logger.error("Failed to read error response", ex);
}
}

exitCode = 1;

Expand Down

0 comments on commit 1977131

Please sign in to comment.