Skip to content

fix: expose Kraken errors in KrakenException message - #114

Merged
nyg merged 1 commit into
masterfrom
nyg/kraken-exception-message
Sep 25, 2026
Merged

nyg merged 1 commit into
masterfrom
nyg/kraken-exception-message

Conversation

@nyg

@nyg nyg commented Sep 25, 2026

Copy link
Copy Markdown
Owner

Summary

KrakenException stored the errors returned by Kraken but never passed a message to RuntimeException, so getMessage() returned null. Tools that report exceptions through their message hid the actual error. For example, running EarnOverviewExample with a rejected API key made Maven print only null: KrakenException, and the underlying EAPI:Invalid key stayed hidden.

The constructor now sets the message to the errors joined with , , e.g. EAPI:Invalid key or EGeneral:Invalid arguments, EGeneral:Permission denied. For Funding (Beta) HTTP errors, the message is the status code followed by the response body. getErrors() is unchanged. A null error list, which Jackson produces when the envelope has no error field, still produces a null message instead of throwing a NullPointerException.

Testing

  • New KrakenExceptionTest covers one error, several errors and a missing error list.
  • mvnd -B clean verify passes: 597 tests.
  • EarnOverviewExample run against the live API with an invalid key now fails with An exception occurred while executing the Java class. EAPI:Invalid key.

@sonarqubecloud

Copy link
Copy Markdown

@nyg
nyg merged commit 6725a2e into master Sep 25, 2026
7 checks passed
@nyg
nyg deleted the nyg/kraken-exception-message branch September 25, 2026 17:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant