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

25
LINES

< > BotCompany Repo | #1015952 - _handleException

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

Libraryless. Click here for Pure Java version (2729L/16K).

static volatile PersistableThrowable _handleException_lastException;
static L _handleException_onException = synchroList(ll(f printStackTrace2));
sbool _handleException_showThreadCancellations;

svoid _handleException(Throwable e) {
  _handleException_lastException = persistableThrowable(e);
  
  Throwable e2 = innerException(e);
  if (e2.getClass() == RuntimeException.class && eq(e2.getMessage(), "Thread cancelled.") || e2 instanceof InterruptedException) {
    if (_handleException_showThreadCancellations)
      System.out.println(getStackTrace_noRecord(e2));
    ret;
  }

  for (O f : cloneList(_handleException_onException)) try {
    callF(f, e);
  } catch e3 {
    try {
      printStackTrace2(e3); // not using pcall here - it could lead to endless loops
    } catch e4 {
      System.out.println(getStackTrace(e3));
      System.out.println(getStackTrace(e4));
    }
  }
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1015952
Snippet name: _handleException
Eternal ID of this version: #1015952/19
Text MD5: d4d0f942b38c0c8dd45c46912ffb0e7f
Transpilation MD5: a40acea0a5f62d2049555c07950c22ee
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-05-19 20:32:59
Source code size: 910 bytes / 25 lines
Pitched / IR pitched: No / No
Views / Downloads: 278 / 344
Version history: 18 change(s)
Referenced in: [show references]

Formerly at http://tinybrain.de/1015952 & http://1015952.tinybrain.de