From 76097f9c968518ab53577e4adb9b6ec13d5b4738 Mon Sep 17 00:00:00 2001
From: Adam Garside <adam.garside@gmail.com>
Date: Wed, 15 May 2013 10:37:45 -0400
Subject: [PATCH] Typo fixes, tighter error handling, corrected check mode
 support

---
 notification/campfire | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/notification/campfire b/notification/campfire
index 4ba0b2cbf1a..348d9aa910a 100644
--- a/notification/campfire
+++ b/notification/campfire
@@ -78,7 +78,7 @@ def main():
                                  "tada", "tmyk", "trombone", "vuvuzela",
                                  "yeah", "yodel"]),
         ),
-        supports_check_mode=True
+        supports_check_mode=False
     )
 
     subscription = module.params["subscription"]
@@ -117,8 +117,14 @@ def main():
         req.add_header('User-agent', AGENT)
         response = opener.open(req)
 
+    except urllib2.HTTPError, e:
+        if not (200 <= e.code < 300):
+            module.fail_json(msg="unable to send msg: '%s', campfire api"
+                                 " returned error code: '%s'" %
+                                 (msg, e.code))
+
     except Exception, e:
-        module.fail_json(msg="unable to sent msg: %s" % e)
+        module.fail_json(msg="unable to send msg: %s" % msg)
 
     module.exit_json(changed=True, room=room, msg=msg, notify=notify)