Sha256: c0849f701d23b19b1209fd76316eda37c2d2964de2e9abc62dfd49ae3412fd95

Contents?: true

Size: 608 Bytes

Versions: 4

Compression:

Stored size: 608 Bytes

Contents

module Errdo
  class Exception

    def initialize(env)
      user_parser = Errdo::Models::UserParser.new(env)
      @env_parser = Errdo::Models::ErrorEnvParser.new(env, user_parser)

      error = nil
      error = create_errors(@env_parser) unless Errdo.error_name.blank?
      Errdo.notify_with.each do |notifier|
        notifier.notify(@env_parser, error: error)
      end
    end

    private

    def create_errors(parser)
      error = Errdo::Error.find_or_create(parser.error_hash)
      error.try(:error_occurrences).try(:create, parser.error_occurrence_hash)
      return error
    end

  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
errdo-0.12.0 app/models/errdo/exception.rb
errdo-0.11.6 app/models/errdo/exception.rb
errdo-0.11.5 app/models/errdo/exception.rb
errdo-0.11.4 app/models/errdo/exception.rb