Skip to content

feat(exceptionMessage): py,php,js,cs,go#27584

Merged
carlosmiei merged 8 commits intoccxt:masterfrom
ttodua:exceptionMsg-fix
Jan 2, 2026
Merged

feat(exceptionMessage): py,php,js,cs,go#27584
carlosmiei merged 8 commits intoccxt:masterfrom
ttodua:exceptionMsg-fix

Conversation

@ttodua
Copy link
Member

@ttodua ttodua commented Dec 24, 2025


for Java, you might use:

public String exceptionMessage(Exception exc, boolean includeStack) {
    String message = "[" + exc.getClass().getSimpleName() + "] " + (!includeStack ? exc.getMessage() : getStackTrace(exc));
    int length = Math.min(10000, message.length());
    return message.substring(0, length);
}

private String getStackTrace(Exception exc) {
    StringWriter sw = new StringWriter();
    PrintWriter pw = new PrintWriter(sw);
    exc.printStackTrace(pw);
    return sw.toString();
}

@ttodua ttodua marked this pull request as ready for review December 25, 2025 10:10
@carlosmiei carlosmiei merged commit 053de30 into ccxt:master Jan 2, 2026
6 of 11 checks passed
@carlosmiei carlosmiei deleted the exceptionMsg-fix branch January 2, 2026 11:02
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.

2 participants