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

7
LINES

< > BotCompany Repo | #1015676 // unwrapTrivialExceptionWraps - unwrap rethrow()s

JavaX fragment (include)

static Throwable unwrapTrivialExceptionWraps(Throwable e) {
  if (e == null) ret e;
  while (e.getClass() == RuntimeException.class
    && e.getCause() != null && eq(e.getMessage(), str(e.getCause())))
    e = e.getCause();
  ret e;
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1015676
Snippet name: unwrapTrivialExceptionWraps - unwrap rethrow()s
Eternal ID of this version: #1015676/1
Text MD5: 219aa0e39c6733b2de9d6e312d09a0b2
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-05-21 11:15:53
Source code size: 240 bytes / 7 lines
Pitched / IR pitched: No / No
Views / Downloads: 254 / 386
Referenced in: [show references]