Skip to content

Instantly share code, notes, and snippets.

@wilig
Created July 22, 2010 18:54
Show Gist options
  • Save wilig/486410 to your computer and use it in GitHub Desktop.
Save wilig/486410 to your computer and use it in GitHub Desktop.
(defmacro handle-failure
[& forms]
(let [[body handler] (split-with (complement handler-form?) forms)
e# (symbol "errors")]
`(kit/with-handler
~@body
(kit/handle validation-error [~e#]
~@(rest (first handler))))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment