Commit 13508c3

mo <mo.khan@gmail.com>
2018-05-19 17:38:02
catch errors.
1 parent 9397f0c
Changed files (2)
lib/del/cli.rb
@@ -39,7 +39,7 @@ module Del
       ).run(jid, message)
     end
 
-    desc 'status <status> <message>', 'status to online, offline, away, or busy'
+    desc 'status <status> <message>', 'status to online, away, or busy'
     def status(status, message = nil)
       socket = SocketMessage.new(self, socket_file: options[:socket_file])
       socket.deliver(command: :change_status, status: status, message: message)
lib/del/tron.rb
@@ -41,6 +41,8 @@ module Del
     def change_status(request)
       robot.public_send("#{request['status'].downcase}!", request['message'])
       'Done!'
+    rescue
+      "Error: Invalid status"
     end
   end
 end