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

13
LINES

< > BotCompany Repo | #1034838 // TimeoutException_Inner - makes the thread's stack trace the main one

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

Libraryless. Click here for Pure Java version (5356L/29K).

sclass TimeoutException_Inner extends RuntimeExceptionWithCustomStackTrace {
  Thread thread;
  double timeoutSeconds;
  O function;

  *(double *timeoutSeconds,
    O *function,
    Thread *thread) {
    super("Timeout after " + iceil(timeoutSeconds) + "s by " + shorten_str(function),
      new Throwable("Caller"),
      thread.getStackTrace());
  }
}

Author comment

Began life as a copy of #1034249

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1034838
Snippet name: TimeoutException_Inner - makes the thread's stack trace the main one
Eternal ID of this version: #1034838/4
Text MD5: 9abddc6d9b733f6afd4a8b30b25e5388
Transpilation MD5: aed681586a38defa40b9001c4bca7a10
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-03-11 03:38:03
Source code size: 366 bytes / 13 lines
Pitched / IR pitched: No / No
Views / Downloads: 78 / 158
Version history: 3 change(s)
Referenced in: [show references]