(throw-if v)Throw 'v' if is throwable otherwise return it as is.
Throw 'v' if is throwable otherwise return it as is.
(with-exception->value exception-mapping & body)Evaluates body & returns its result. In the event of an exception, 'exception-mapping's can be provided which map an exception type to a sentinel value that can be returned in it's place.
An exception type not specified in 'exception-map' will not be caught.
e.g., (with-exception->value [Exception :something-wrong NumberFormatException :could-not-covert] (Long/parseLong "foo"))
Evaluates body & returns its result. In the event of an exception,
'exception-mapping's can be provided which map an exception type to
a sentinel value that can be returned in it's place.
An exception type not specified in 'exception-map' will not be
caught.
e.g.,
(with-exception->value
[Exception :something-wrong
NumberFormatException :could-not-covert]
(Long/parseLong "foo"))cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |