Skip to content

Commit

Permalink
Fix syntax error and return true/false rather than exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
AdamClements committed Mar 24, 2014
1 parent a3bce6e commit 9cfcd8b
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/muscat.clj
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,13 @@
possible to connect)"
[uri topic data
& {:keys [payload-coercion qos retained?]
:or {payload-coercion muscat/clj->ednbytes
:or {payload-coercion clj->ednbytes
qos :at-least-once
retained? false}}]
(let [qos-int ({:fire-and-forget 0 :at-least-once 1 :exactly-once 2})]
(publish* uri topic data qos payload-coercion retained?)))
(let [qos-int ({:fire-and-forget 0 :at-least-once 1 :exactly-once 2} qos)]
(try
(publish* uri topic data qos-int payload-coercion retained?)
true
(catch Exception cause
(println cause)
false))))

0 comments on commit 9cfcd8b

Please sign in to comment.