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

8
LINES

< > BotCompany Repo | #1032477 // innerExceptionOfType

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

Libraryless. Click here for Pure Java version (3795L/22K).

static <A> A nuLike innerExceptionOfType(Class<A> c, Throwable e) {
  while ping (true) {
    if (e == null) null;
    if (isInstanceOf(e, c))
      ret (A) e;
    e = e.getCause();
  }
}

Author comment

Began life as a copy of #1001151

download  show line numbers  debug dex  old transpilations   

Travelled to 4 computer(s): bhatertpkbcr, mowyntqkapby, mqqgnosmbjvj, pyentgdyhuwx

No comments. add comment

Snippet ID: #1032477
Snippet name: innerExceptionOfType
Eternal ID of this version: #1032477/3
Text MD5: 4318f68ba7291ed1a44f1e92cad9977e
Transpilation MD5: 342392eb1f2c81d7047373207e574bd2
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-09-08 07:57:46
Source code size: 194 bytes / 8 lines
Pitched / IR pitched: No / No
Views / Downloads: 184 / 262
Version history: 2 change(s)
Referenced in: [show references]