Skip to content

Commit

Permalink
add :default write-bencode method in order to throw a useful exception
Browse files Browse the repository at this point in the history
  • Loading branch information
cemerick committed Aug 10, 2012
1 parent eb0ba22 commit 24f5376
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/main/clojure/clojure/tools/nrepl/bencode.clj
Expand Up @@ -325,6 +325,10 @@
(.isArray (class thing)))
:list)))

(defmethod write-bencode :default
[output x]
(throw (IllegalArgumentException. (str "Cannot write value of type " (class x)))))

;; The following methods should be pretty straight-forward.
;;
;; The easiest case is of course when we already have a byte array.
Expand Down

0 comments on commit 24f5376

Please sign in to comment.