Sha256: 487bd1d008fd32020a50b55e3776c9917e5093a5a48f97d203e8b4031895267b

Contents?: true

Size: 915 Bytes

Versions: 6

Compression:

Stored size: 915 Bytes

Contents

require 'inbox-sync/notice/base'

module InboxSync; end
module InboxSync::Notice

  class RunSyncError < Base

    BODY = %{
:sync_name

An error happened while running this sync.  The error has
been logged but no mail items from this sync's source are
being sync'd.  The runner will continue to attempt this
sync so mails like this will continue until the problem
is fixed.

Error
=====
  :error_message (:error_name)
  :error_backtrace
    }.strip.freeze

    def initialize(smtp, config, data={})
      @error = data[:error]
      @sync = data[:sync]

      super(smtp, config)
    end

    def subject
      super("sync run error (#{@sync.uid})")
    end

    def body
      @body ||= BODY.
        gsub(':sync_name', @sync.name).
        gsub(':error_message', @error.message).
        gsub(':error_name', @error.class.name).
        gsub(':error_backtrace', @error.backtrace.join("\n  "))
    end

  end

end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
inbox-sync-0.4.1 lib/inbox-sync/notice/run_sync_error.rb
inbox-sync-0.4.0 lib/inbox-sync/notice/run_sync_error.rb
inbox-sync-0.3.0 lib/inbox-sync/notice/run_sync_error.rb
inbox-sync-0.2.1 lib/inbox-sync/notice/run_sync_error.rb
inbox-sync-0.2.0 lib/inbox-sync/notice/run_sync_error.rb
inbox-sync-0.1.0 lib/inbox-sync/notice/run_sync_error.rb