Skip to content

Commit

Permalink
DeployGate::RavenIgnoreExceptionを継承したエラークラスをスローする
Browse files Browse the repository at this point in the history
  • Loading branch information
jiikko committed Dec 23, 2021
1 parent 1200021 commit fd8b753
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 16 deletions.
1 change: 0 additions & 1 deletion lib/deploygate.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ module DeployGate
require "deploygate/api/v1/users/app"
require "deploygate/api/v1/users/apps/cli_websockets"
require "deploygate/command_builder"
require "deploygate/commands"
require "deploygate/commands/login"
require "deploygate/commands/logout"
require "deploygate/commands/config"
Expand Down
9 changes: 0 additions & 9 deletions lib/deploygate/command_builder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,6 @@ def run
options.default :terminal => false
begin
Commands::Login.run(args, options)
rescue Commands::AccountNotFoundError => e
puts HighLine.color(I18n.t('errors.account_not_found_error'), HighLine::RED)
exit 1
rescue => e
error_handling(LOGIN, e)
exit 1
Expand All @@ -77,9 +74,6 @@ def run
options.default :message => '', :user => nil, :open => false, 'disable_notify' => false, :command => nil
begin
Commands::Deploy.run(args, options)
rescue Commands::AccountNotFoundError => e
puts HighLine.color(I18n.t('errors.account_not_found_error'), HighLine::RED)
exit 1
rescue => e
error_handling(DEPLOY, e)
exit 1
Expand All @@ -101,9 +95,6 @@ def run
options.default :user => nil, :server => false, :command => 'add_devices'
begin
Commands::AddDevices.run(args, options)
rescue Commands::AccountNotFoundError => e
puts HighLine.color(I18n.t('errors.account_not_found_error'), HighLine::RED)
exit 1
rescue => e
error_handling(ADD_DEVICES, e)
exit 1
Expand Down
5 changes: 0 additions & 5 deletions lib/deploygate/commands.rb

This file was deleted.

4 changes: 3 additions & 1 deletion lib/deploygate/commands/login.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
module DeployGate
module Commands
class Login
class AccountNotFoundError < DeployGate::RavenIgnoreException; end

class << self

# @return [void]
Expand Down Expand Up @@ -33,7 +35,7 @@ def start_login
puts ''
start(email, password)
else
raise AccountNotFoundError, 'No users matching email were found'
raise AccountNotFoundError, HighLine.color(I18n.t('errors.account_not_found_error'))
end
end

Expand Down

0 comments on commit fd8b753

Please sign in to comment.