Sha256: 1bbe560773bf0ab6477547142c76407e31b058c1d78ef46e905b95f561a5e8ae

Contents?: true

Size: 511 Bytes

Versions: 7

Compression:

Stored size: 511 Bytes

Contents

module Toro
  module Middleware
    module Server
      class ErrorStorage
        def call(job, worker)
          begin
            yield
          rescue Exception => exception
            job.reload
            job.set_properties(
              'error:class' => exception.class.name,
              'error:message' => exception.message,
              'error:backtrace' => exception.backtrace
            )
            job.save
            raise exception
          end
        end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
toro-0.2.2 lib/toro/middleware/server/error_storage.rb
toro-0.2.1 lib/toro/middleware/server/error_storage.rb
toro-0.2.0 lib/toro/middleware/server/error_storage.rb
toro-0.1.1 lib/toro/middleware/server/error_storage.rb
toro-0.1.0 lib/toro/middleware/server/error_storage.rb
toro-0.0.3 lib/toro/middleware/server/error_storage.rb
toro-0.0.2 lib/toro/middleware/server/error_storage.rb