From 0c032db7a4fd265cb487b4baaf674b3f8408bb84 Mon Sep 17 00:00:00 2001 From: Kuba Suder Date: Thu, 16 May 2024 22:35:23 +0200 Subject: [PATCH] pass the operation JSON to the error handler --- lib/didkit/plc_importer.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/didkit/plc_importer.rb b/lib/didkit/plc_importer.rb index b9c63b5..e105c01 100644 --- a/lib/didkit/plc_importer.rb +++ b/lib/didkit/plc_importer.rb @@ -32,7 +32,7 @@ def ignore_errors=(val) @ignore_errors = val if val - @error_handler = proc { |e| "(ignore error)" } + @error_handler = proc { |e, j| "(ignore error)" } else @error_handler = nil end @@ -56,7 +56,7 @@ def fetch_page begin PLCOperation.new(json) rescue PLCOperation::FormatError, AtHandles::FormatError, ServiceRecord::FormatError => e - @error_handler ? @error_handler.call(e) : raise + @error_handler ? @error_handler.call(e, json) : raise end end