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.

1  
static <A> OKOrError<A> okOrError(IF0<A> f, bool printStackTrace default true) {
2  
  try {
3  
    ret OKOrError_ok(f!);
4  
  } catch e {
5  
    if (printStackTrace) printStackTrace(e);
6  
    ret OKOrError_error(e);
7  
  }
8  
}
9  
10  
static <A> OKOrError<A> okOrError(Runnable r) {
11  
  ret okOrError(runnableToIF0(r));
12  
}

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: 199 / 296
Version history: 3 change(s)
Referenced in: [show references]