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

12
LINES

< > BotCompany Repo | #1031740 // okOrError

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

Transpiled version (5168L) is out of date.

static <A> OKOrError<A> okOrError(IF0<A> f, bool printStackTrace default true) {
  try {
    ret OKOrError_ok(f!);
  } catch e {
    if (printStackTrace) printStackTrace(e);
    ret OKOrError_error(e);
  }
}

static <A> OKOrError<A> okOrError(Runnable r) {
  ret okOrError(runnableToIF0(r));
}

Author comment

Began life as a copy of #1014009

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1031740
Snippet name: okOrError
Eternal ID of this version: #1031740/4
Text MD5: d35c6047dd1b19940cb9d2a55894b1b1
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-05-26 17:21:20
Source code size: 304 bytes / 12 lines
Pitched / IR pitched: No / No
Views / Downloads: 132 / 208
Version history: 3 change(s)
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)