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

10
LINES

< > BotCompany Repo | #1001151 // getInnerException

JavaX fragment (include)

static Throwable getInnerException(Throwable e) {
  if (e == null) null;
  while (e.getCause() != null)
    e = e.getCause();
  return e;
}

static Throwable getInnerException(Runnable r) {
  ret getInnerException(getException(r));
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1001151
Snippet name: getInnerException
Eternal ID of this version: #1001151/2
Text MD5: bce587751f40c7cd8684c15e4ad68c5e
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-09-30 20:03:36
Source code size: 242 bytes / 10 lines
Pitched / IR pitched: No / No
Views / Downloads: 699 / 3098
Version history: 1 change(s)
Referenced in: #1002427 - Accellerating 629 (SPIKE)
#1004560 - getInnerMessage - try to get innermost message of exception chain
#1006654 - Standard functions list 2 (LIVE, continuation of #761)
#1010434 - innerException - synonym of getInnerException
#1013186 - getExceptionCause - goes just one level deep
#1020623 - innerException2 - descends only when message is empty
#1032477 - innerExceptionOfType