Skip to content

Instantly share code, notes, and snippets.

@MichaelDrogalis
Created May 13, 2014 01:42
Show Gist options
  • Select an option

  • Save MichaelDrogalis/cd250905bba75741f77e to your computer and use it in GitHub Desktop.

Select an option

Save MichaelDrogalis/cd250905bba75741f77e to your computer and use it in GitHub Desktop.
(defn run-query [q]
(info "Executing query: " q)
(try
(if-not (nil? q)
(let [result (database/query *db* q)]
(metrics/record-db-hit)
{:error :nil-query})
(catch Exception e
(warn "Error issuing query" q)
{:error :database-error})))
@jamesaoverton
Copy link

Thank you for this compact example of complected code. I think there's a missing line between 6 and 7: result)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment