ddr-batch 1.7.1 → 1.7.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ff62844894c1f12fda34b51a26f253cc6867275b
4
- data.tar.gz: b4a0b69ab2fb21234d4e7d6832d9de9fe6fbbe1f
3
+ metadata.gz: e356a65a70813c599af04d01d764de1109d98f5e
4
+ data.tar.gz: 4ac1235826c5fce10d7990f16ad9636d771169ba
5
5
  SHA512:
6
- metadata.gz: 0cf26788666c1709addcd45eaba8927a01f975eaca4b0d5aa8cf9bae304ac75fdb9208e0053e158ac0e72d26eec92fb531c17bbf1090892abd08ed387508b7cc
7
- data.tar.gz: 558e0293761f5aa2fcab260e8c1b967ad744cfbe3d77be271ef09c8509e318f128202596c5096b62ec283c7278e00bacf8d1eea272d1be7d9e6b7f341b73f2b1
6
+ metadata.gz: 10ea52dce76f86f9c9965ebe8d594f2a2c5c7ab3329cb7fe759d7fac9f6122adf84d929c350daab37334a86aa1088f48766c407e5541f00b76c5a405257380d3
7
+ data.tar.gz: f397545eb2d5741fbcb9ece062f0e4c1f82e8eec0e952314de3bdab6ec595e128d3cbdc56406a52b2d372ef86ee497481aeb93281ca3bcea359b6b9eb52cac63
@@ -6,11 +6,21 @@ module Ddr::Batch
6
6
  event = ActiveSupport::Notifications::Event.new(*args)
7
7
  batch_object = BatchObject.find(event.payload[:batch_object_id])
8
8
  batch = batch_object.batch
9
+ if event.payload[:exception].present?
10
+ record_batch_object_exception(batch_object, event.payload[:exception])
11
+ end
9
12
  batch_object_handled(batch_object, batch)
10
13
  end
11
14
 
12
15
  private
13
16
 
17
+ def record_batch_object_exception(batch_object, exception_info)
18
+ batch_object_exception_msg = I18n.t('ddr.batch.errors.batch_object_processing', error_msg: exception_info[1])
19
+ Ddr::Batch::BatchObjectMessage.create!(batch_object: batch_object,
20
+ level: Logger::ERROR,
21
+ message: batch_object_exception_msg)
22
+ end
23
+
14
24
  def batch_object_handled(batch_object, batch)
15
25
  log_batch_object_messages(batch_object, batch.id)
16
26
  batch_object.update!(handled: true)
@@ -3,6 +3,7 @@ en:
3
3
  batch:
4
4
  errors:
5
5
  prefix: "%{identifier}:"
6
+ batch_object_processing: "Error processing batch object: %{error_msg}"
6
7
  no_batches: "No %{type} batches found for your user account."
7
8
  web:
8
9
  action_names:
@@ -1,5 +1,5 @@
1
1
  module Ddr
2
2
  module Batch
3
- VERSION = "1.7.1"
3
+ VERSION = "1.7.2"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ddr-batch
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.1
4
+ version: 1.7.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jim Coble
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2018-08-28 00:00:00.000000000 Z
12
+ date: 2018-08-31 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails