Skip to content
This repository has been archived by the owner on Jan 3, 2022. It is now read-only.

Commit

Permalink
return :INVALID for bad numbers in load-int
Browse files Browse the repository at this point in the history
  • Loading branch information
alexgartrell committed Apr 18, 2011
1 parent 7de3038 commit f7198b1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/tnetstrings/core.clj
Expand Up @@ -31,7 +31,9 @@
data)

(defn- load-int [data]
(Integer. data))
(try
(Integer. data)
(catch java.lang.NumberFormatException e :INVALID)))

(defn- load-bool [data]
(cond (= data "true") true
Expand Down

0 comments on commit f7198b1

Please sign in to comment.