Skip to content

Instantly share code, notes, and snippets.

@nmrshll
Last active August 29, 2018 11:21
Show Gist options
  • Save nmrshll/ce06e8fc14d2205a327f9913f5f14257 to your computer and use it in GitHub Desktop.
Save nmrshll/ce06e8fc14d2205a327f9913f5f14257 to your computer and use it in GitHub Desktop.
fn passErr(err) ==> { throw err }
fn logErr(err) ==> { log.Error(err) }
fn ignoreErr(err) ==> {}
out1 := try SomeFunc1(arg1,arg2), catch logErr
out2 := try SomeFunc2(arg1),
catch passErr
out3 := try SomeFunc3(arg1). catch (err) ==> errwrap.wrapErr("additional error info")
out4 := try SomeFunc4(arg1), catch (err) ==> {
process(err)
}
try return SomeFunc1(arg1, arg2), catch ignoreErr
try return SomeFunc2(arg2), catch ignoreErr
return nil
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment