Skip to content

Commit

Permalink
Added some stack trace logging temporarily
Browse files Browse the repository at this point in the history
  • Loading branch information
johncowie committed Feb 10, 2013
1 parent 04f1372 commit aa91cc4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 3 additions & 0 deletions src/nuotl_twitter/core.clj
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,12 @@
(try
(do
(p/process-tweet tweet)
(println "SUCCESS")
(r/respond (get-reply-fn twitter) tweet :success))
(catch Exception e
(. e (printStackTrace))
(let [error-code (read-string (. e (getMessage)))]
(println (format "PROCESSING ERROR: %s" error-code))
(r/respond (get-reply-fn twitter) tweet error-code)
)))
(dao/add-reply-id (tweet :_id) (tweet :in-response-to))
Expand Down
5 changes: 2 additions & 3 deletions src/nuotl_twitter/responder.clj
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,11 @@

(defn- tweet-url [tweet code]
(if (= code :success)
(let [month (t/month (tweet :start))
year (t/year (tweet :start))]
(format "http://nextupontheleft.org/events/%s/%s#%s" year month (tweet :_id)))
(format "http://nextupontheleft.org/events#%s" (tweet :_id))
(format "http://twitter.com/%s/status/%s" ((tweet :tweeter) :_id) (tweet :_id))))

(defn respond [replyfn tweet code]
(println "CODE: " code)
(if-not (or (nil? code) (= code :is-me))
(let [name (:name (:tweeter tweet))
tweet-id (:_id tweet)
Expand Down

0 comments on commit aa91cc4

Please sign in to comment.