Skip to content

Commit

Permalink
sql.internal: use enhanced throwf from except
Browse files Browse the repository at this point in the history
  • Loading branch information
scgilardi committed Jun 6, 2009
1 parent dffe807 commit 47fefa2
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/clojure/contrib/sql/internal.clj
Expand Up @@ -14,7 +14,7 @@
(ns clojure.contrib.sql.internal
(:use
(clojure.contrib
[except :only (throw-arg)]
[except :only (throwf throw-arg)]
[java-utils :only (as-properties)]
[seq-utils :only (indexed)]))
(:import
Expand All @@ -39,7 +39,7 @@
"Returns the current database connection (or throws if there is none)"
[]
(or (find-connection*)
(throw (Exception. "no current database connection"))))
(throwf "no current database connection")))

(defn rollback
"Accessor for the rollback flag on the current connection"
Expand Down Expand Up @@ -132,8 +132,7 @@
"Sets rollback and throws a wrapped exception"
[e]
(rollback true)
(throw
(Exception. (format "transaction rolled back: %s" (.getMessage e)) e)))
(throwf e "transaction rolled back: %s" (.getMessage e)))

(defn transaction*
"Evaluates func as a transaction on the open database connection. Any
Expand Down

0 comments on commit 47fefa2

Please sign in to comment.