hekenga 1.0.3 → 1.0.4

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
  SHA256:
3
- metadata.gz: 4a5b2feed38ae6373320ea9097c0677cd3ba26c9ed72485d802abf846c4474d4
4
- data.tar.gz: bbdaadd072871e04936b451f584c1ff72e111a7d26993b9e87c58df9f50fd7f7
3
+ metadata.gz: 55037feb4349d723dd34938f3eb9aab8431bad7f287081b685705c6a6d40b046
4
+ data.tar.gz: 896bdc203b3f30c543a4f7265bdea16e128d64ed59456e32cecb683a789f684c
5
5
  SHA512:
6
- metadata.gz: 1f93f0e083ca321cdc5be3ade1c8e32ec72ac57c4520073e91b8b6bede680a88dd13d921cc8efdc45b6352b307a9996f92c10c1eac4cf61c5857fd6eaf7ae250
7
- data.tar.gz: 8dca120b22a5a4a270f8649f8dfa53609d11c803b17dd901c0a2f0e524b25bb91a9ae342c6782a2d60d59a8a29abc8c9c285a099772ca4403bb91c254d9a0a93
6
+ metadata.gz: 69a634184500d3c5cca3298a3793c0e5f496d31f935af6265840e1ab7e576de9bc06623cff8c03738fed9f2028146d460fd7ed04cd71e3f684c890a792d6986e
7
+ data.tar.gz: 2b916adfaa97a95fa645cd6442aefacd5125f78c2b62ff1b13bfa237e373998ecd44f0c88bdc0b7a239afa9e8f25e2bfb2cc05a4de11f142898c42ce963f246c
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## v1.0.4
4
+
5
+ - Log errors during document tasks to stdout
6
+
3
7
  ## v1.0.3
4
8
 
5
9
  - Fix `timeless!` being ignored
@@ -13,6 +13,7 @@ module Hekenga
13
13
  @skipped_records = []
14
14
  @failed_records = []
15
15
  @backed_up_records = {}
16
+ @seen_errors = []
16
17
  end
17
18
 
18
19
  def run!
@@ -48,7 +49,9 @@ module Hekenga
48
49
 
49
50
  delegate :task_idx, to: :task_record
50
51
 
51
- attr_reader :migrated_records, :records_to_write, :filtered_records, :invalid_records, :skipped_records, :failed_records, :backed_up_records
52
+ attr_reader :migrated_records, :records_to_write, :filtered_records,
53
+ :invalid_records, :skipped_records, :failed_records, :backed_up_records,
54
+ :seen_errors
52
55
 
53
56
  def migration_complete?
54
57
  migration.task_records(task_idx).incomplete.none?
@@ -84,7 +87,8 @@ module Hekenga
84
87
  else
85
88
  skipped_records << record
86
89
  end
87
- rescue => _e
90
+ rescue => e
91
+ print_error(e)
88
92
  failed_records << record
89
93
  end
90
94
  end
@@ -94,7 +98,8 @@ module Hekenga
94
98
  backup_record(record)
95
99
  task.up!(@context, record)
96
100
  migrated_records << record
97
- rescue => _e
101
+ rescue => e
102
+ print_error(e)
98
103
  failed_records << record
99
104
  end
100
105
  end
@@ -268,5 +273,13 @@ module Hekenga
268
273
  def task
269
274
  @task ||= migration.tasks[task_idx]
270
275
  end
276
+
277
+ def print_error(error)
278
+ message = [error.message, error.backtrace].join("\n")
279
+ return if seen_errors.include?(message.hash)
280
+
281
+ seen_errors << message.hash
282
+ Hekenga.log(message)
283
+ end
271
284
  end
272
285
  end
@@ -1,3 +1,3 @@
1
1
  module Hekenga
2
- VERSION = "1.0.3"
2
+ VERSION = "1.0.4"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hekenga
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 1.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tapio Saarinen
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-10-08 00:00:00.000000000 Z
11
+ date: 2023-11-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler