Class: DTK::Client::GitErrorHandler

Inherits:
Object
  • Object
show all
Defined in:
lib/domain/git_error_handler.rb

Class Method Summary collapse

Class Method Details

.handle(exception) ⇒ Object

due to problems with git logging messages which are not user friendly we are going to wrap their error and try to produce more readable results



32
33
34
35
36
37
38
39
40
41
# File 'lib/domain/git_error_handler.rb', line 32

def self.handle(exception)
  handled_exception = exception

  if exception.is_a? Git::GitExecuteError
    error_message = user_friendly_message(exception.message)
    handled_exception = GitHandledException.new(error_message, exception.backtrace)
  end

  handled_exception
end