Class: Deploy::ErrorHandler

Inherits:
Object
  • Object
show all
Includes:
Singleton
Defined in:
lib/deploy/error_handler.rb

Constant Summary collapse

ERROR_MESSAGES =
{
  'Aws::Errors::MissingCredentialsError'        => 'Missing AWS credentials. Error thrown by AWS',
  'Aws::ElasticBeanstalk::Errors::ServiceError' => 'Error thrown by AWS EB',
  'Aws::S3::Errors::ServiceError'               => 'Error thrown by AWS S3'
}

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.with_error_handling(&block) ⇒ Object



13
14
15
# File 'lib/deploy/error_handler.rb', line 13

def self.with_error_handling(&block)
  instance.with_error_handling(&block)
end

Instance Method Details

#with_error_handlingObject



17
18
19
20
21
# File 'lib/deploy/error_handler.rb', line 17

def with_error_handling
  yield
rescue RuntimeError => error
  fail message_for(error)
end