Skip to content

Instantly share code, notes, and snippets.

@l1x
Created December 16, 2014 20:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save l1x/3e991063483f1204536f to your computer and use it in GitHub Desktop.
Save l1x/3e991063483f1204536f to your computer and use it in GitHub Desktop.
works=> (try {:ok (slurp "//ads/ad/as/dasd/asd") } (catch Exception e {:error "Exception" :fn "read-file" :exception (.getMessage e) }))
{:error "Exception", :fn "read-file", :exception "/ads/ad/as/dasd/asd (No such file or directory)"}
doesnt=> (try {:ok (map inc (list 1 2 3 "asd")) } (catch Exception e {:error "Exception" :fn "read-file" :exception (.getMessage e) }))
ClassCastException java.lang.String cannot be cast to java.lang.Number clojure.lang.Numbers.inc (Numbers.java:110)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment