troessner/reek

View on GitHub
lib/reek/logging_error_handler.rb

Summary

Maintainability
A
0 mins
Test Coverage
# frozen_string_literal: true

require_relative 'errors/base_error'

module Reek
  # Handles errors by logging to stderr
  class LoggingErrorHandler
    def handle(exception)
      case exception
      when Errors::BaseError
        warn exception.long_message
      else
        warn exception.message
      end
      true
    end
  end
end