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

9
LINES

< > BotCompany Repo | #1002197 // formatExceptionForUser

JavaX fragment (include)

// also logs full exception to console
static S formatExceptionForUser(Throwable e) {
  printStackTrace(e);
  S msg = unnull(e.getMessage());
  if (msg.indexOf("Error") < 0 && msg.indexOf("Exception") < 0)
    ret dropPrefix("java.lang.", str(e));
  else
    ret msg;
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1002197
Snippet name: formatExceptionForUser
Eternal ID of this version: #1002197/1
Text MD5: 9a5360ca19024a462ceaa309a682d7e2
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2016-03-06 02:57:18
Source code size: 277 bytes / 9 lines
Pitched / IR pitched: No / No
Views / Downloads: 714 / 1726
Referenced in: #1002198 - throwableToUser - short for formatExceptionForUser
#1002427 - Accellerating 629 (SPIKE)
#1003612 - exceptionToStringShort
#1006654 - Standard functions list 2 (LIVE, continuation of #761)
#3000382 - Answer for ferdie (>> t = 1, f = 0)