lib/akashiyaki/command.rb in akashiyaki-0.2.0 vs lib/akashiyaki/command.rb in akashiyaki-0.2.1
- old
+ new
@@ -1,8 +1,9 @@
# frozen_string_literal: true
require "akashiyaki/client"
+require "akashiyaki/errors"
module Akashiyaki
class Command
attr_reader :mode, :action, :account
@@ -12,9 +13,12 @@
@account = account
end
def run
client.send(:"#{action}_#{mode}")
+ puts "Succeeded!"
+ rescue NotAuthorized => e
+ puts "Failed! #{e.message}"
end
private
def client