Skip to content

Commit

Permalink
airbrake-errbit for error notification
Browse files Browse the repository at this point in the history
  • Loading branch information
elisehuard committed Nov 28, 2012
1 parent f0a8056 commit e6b54d3
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
3 changes: 2 additions & 1 deletion project.clj
Expand Up @@ -8,7 +8,8 @@
[compojure "1.1.3"]
[clj-http "0.5.7"]
[hiccup "1.0.1"]
[ragtime "0.3.2"]]
[ragtime "0.3.2"]
[clj-airbrake "2.0.0"]]
:plugins [[lein-ring "0.7.5"]
[ragtime/ragtime.lein "0.3.2"]]
:ragtime {:migrations ragtime.sql.files/migrations
Expand Down
18 changes: 15 additions & 3 deletions src/wheelcrowd/routes.clj
@@ -1,15 +1,25 @@
(ns wheelcrowd.routes
(:use compojure.core
wheelcrowd.views
wheelcrowd.configuration
[hiccup.middleware :only (wrap-base-url)]
[ring.util.response :only (redirect)])
[ring.util.response :only (redirect)]
clj-airbrake.ring)
(:require [compojure.route :as route]
[compojure.handler :as handler]
[compojure.response :as response]
[clojure.data.json :as json]
[wheelcrowd.location.foursquare :as foursquare]
[wheelcrowd.location :as location]
[wheelcrowd.categories :as categories]))
[wheelcrowd.categories :as categories]
[clj-airbrake.core :as airbrake]))

(airbrake/set-host! "swerve-errbit.herokuapp.com")

(defn wrap-if [handler pred wrapper & args]
(if pred
(apply wrapper handler args)
handler))

(defn- emit-json
[x & [status]]
Expand Down Expand Up @@ -37,4 +47,6 @@

(def app
(-> (handler/site main-routes)
(wrap-base-url)))
(wrap-base-url)
(wrap-if production?
wrap-airbrake (System/getenv "ERRBIT_API_KEY") "production")))

0 comments on commit e6b54d3

Please sign in to comment.