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

13
LINES

< > BotCompany Repo | #1003612 // exceptionToStringShort

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (9559L/54K).

1  
sS exceptionToStringShort(Throwable e) {
2  
  try {
3  
    lastException(e);
4  
    e = getInnerException(e);
5  
    S msg = hideCredentials(unnull(e.getMessage()));
6  
    if (msg.indexOf("Error") < 0 && msg.indexOf("Exception") < 0)
7  
      ret baseClassName(e) + prependIfNempty(": ", msg);
8  
    else
9  
      ret msg;
10  
  } catch print _e {
11  
    ret "Error in exceptionToStringShort";
12  
  }
13  
}

Author comment

Began life as a copy of #1002197

download  show line numbers  debug dex  old transpilations   

Travelled to 15 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, ddnzoavkxhuk, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1003612
Snippet name: exceptionToStringShort
Eternal ID of this version: #1003612/7
Text MD5: 82177bf297234829c9bafc8a7909b03c
Transpilation MD5: 803ee2a3b33a1a08447550c2d0f8725a
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-06-27 04:49:41
Source code size: 382 bytes / 13 lines
Pitched / IR pitched: No / No
Views / Downloads: 645 / 1196
Version history: 6 change(s)
Referenced in: [show references]