Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

9
LINES

< > BotCompany Repo | #1034266 // exceptionToStringShorter_dontDropOuterExceptions

JavaX fragment (include)

sS exceptionToStringShorter_dontDropOuterExceptions(Throwable e) {
  S msg = hideCredentials(unnull(e.getMessage()));
  S className = baseClassName(e);
  if (!eq(className, "RuntimeException")
    && (msg.indexOf("Error") < 0 && msg.indexOf("Exception") < 0))
    ret className + prependIfNempty(": ", msg);
  else
    ret msg;
}

Author comment

Began life as a copy of #1033996

download  show line numbers  debug dex  old transpilations   

Travelled to 3 computer(s): bhatertpkbcr, mowyntqkapby, mqqgnosmbjvj

No comments. add comment

Snippet ID: #1034266
Snippet name: exceptionToStringShorter_dontDropOuterExceptions
Eternal ID of this version: #1034266/3
Text MD5: f97da6586c1a056baf6175e0239e81a4
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-01-29 14:43:11
Source code size: 337 bytes / 9 lines
Pitched / IR pitched: No / No
Views / Downloads: 62 / 87
Version history: 2 change(s)
Referenced in: [show references]