(error e & [opt? & more])
Throws an exception when called.
(error "This is an error") => (throws Exception "This is an error")
(error (Exception. "This is an error") "This is a chained error") => (throws Exception "This is a chained error")
Throws an exception when called. (error "This is an error") => (throws Exception "This is an error") (error (Exception. "This is an error") "This is a chained error") => (throws Exception "This is a chained error")
(suppress body)
(suppress body catch-val)
Suppresses any errors thrown in the body.
(suppress (error "Error")) => nil
(suppress (error "Error") :error) => :error
(suppress (error "Error") (fn [e] (.getMessage e))) => "Error"
Suppresses any errors thrown in the body. (suppress (error "Error")) => nil (suppress (error "Error") :error) => :error (suppress (error "Error") (fn [e] (.getMessage e))) => "Error"
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close