Permalink
Browse files

Move readme to markdown.

  • Loading branch information...
1 parent 152777c commit c2925d9117de32ebe5cc1ea69446f2c6db14002f @technomancy committed Jun 10, 2011
Showing with 28 additions and 13 deletions.
  1. +0 −13 README
  2. +28 −0 README.md
View
@@ -1,13 +0,0 @@
-# DCE
-
-an exception for carrying data
-
-## Usage
-
-as you like
-
-## License
-
-Copyright (C) 2011 Kevin Downey
-
-Distributed under the Eclipse Public License, the same as Clojure.
View
@@ -0,0 +1,28 @@
+# Data-Carrying Exception
+
+An exception for carrying data. Based on clojure.contrib.condition.
+
+Differs from c.c.condition in a few ways:
+
+* the exception is a descendant of RuntimeException rather than direct Throwable
+* the exception may be treated as a Clojure map itself (rather than its metadata)
+* catch clauses may be interspersed with handle causes.
+
+## Usage
+
+ (defn asplode [problem type]
+ (dce.Exception/toss :message (str "Oh no! " problem") :type type))
+
+ (handler-case :type
+ (when-not (success?)
+ (asplode "failed!" :failure))
+ (handle :failure e
+ (log/warn e "stuff failed, dude: " (:message e)))
+ (handle :catastrophic-failure e
+ (System/exit (:exit-code e))))
+
+## License
+
+Copyright (C) 2011 Kevin Downey, Stephen Gilardi, and Phil Hagelberg
+
+Distributed under the Eclipse Public License, the same as Clojure.

0 comments on commit c2925d9

Please sign in to comment.