Skip to content
Browse files

Added try macro, bump to 0.7.1

  • Loading branch information...
1 parent e50112a commit ac6f5e6e5bbe244726a70552b445e449cae76bbe @zk committed Apr 6, 2011
Showing with 12 additions and 3 deletions.
  1. +1 −1 project.clj
  2. +11 −1 src/clj_exceptional.clj
  3. +0 −1 src/clj_exceptional/core.clj
View
2 project.clj
@@ -1,4 +1,4 @@
-(defproject clj-exceptional "0.7.0"
+(defproject clj-exceptional "0.7.1"
:description "Clojure client for Exceptional http://getexceptional.com"
:dependencies [[org.clojure/clojure "1.2.0"]
[org.clojure/clojure-contrib "1.2.0"]
View
12 src/clj_exceptional.clj
@@ -2,7 +2,8 @@
(:require [cheshire.core :as che]
[clj-http.client :as client]
[clj-http.util :as cutil])
- (:import [java.text SimpleDateFormat]))
+ (:import [java.text SimpleDateFormat])
+ (:refer-clojure :exclude [try]))
(def *root-dir* (.getAbsolutePath (java.io.File. "")))
(def date-format "yyyy-MM-dd'T'HH:mm:ssZZZZ")
@@ -194,6 +195,15 @@
(add-request req)
(handler req))))
+(defmacro try [& body]
+ (let [catch-forms (filter #(= 'catch (first %)) body)
+ forms (filter #(not (= 'catch (first %))) body)]
+ (println forms)
+ `(try
+ (rethrow-exc
+ ~@forms)
+ ~@catch-forms)))
+
(comment
;; Examples from README
View
1 src/clj_exceptional/core.clj
@@ -1 +0,0 @@
-(ns clj-exceptional.core)

0 comments on commit ac6f5e6

Please sign in to comment.
Something went wrong with that request. Please try again.