summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDan Allen <dan.j.allen@gmail.com>2022-03-03 23:57:20 -0700
committerDan Allen <dan.j.allen@gmail.com>2022-03-04 04:57:31 -0700
commit36ff92ab6f6eedcc8a3fc8942110a0d9d01bb129 (patch)
tree58ee15dc726e227a35257a1fb0908a9ba4656a76 /lib
parent9e596ebf6269aa3635e63eb49868bc8fe7c76844 (diff)
capture exception to location variable in block image handler
Diffstat (limited to 'lib')
-rw-r--r--lib/asciidoctor/pdf/converter.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/asciidoctor/pdf/converter.rb b/lib/asciidoctor/pdf/converter.rb
index 81db2c0d..ba2119a5 100644
--- a/lib/asciidoctor/pdf/converter.rb
+++ b/lib/asciidoctor/pdf/converter.rb
@@ -1647,8 +1647,8 @@ module Asciidoctor
end
layout_caption node, category: :image, side: :bottom, block_align: alignment, block_width: rendered_w, max_width: @theme.image_caption_max_width if node.title?
theme_margin :block, :bottom unless pinned
- rescue
- on_image_error :exception, node, target, (opts.merge message: %(could not embed image: #{image_path}; #{$!.message}#{::Prawn::Errors::UnsupportedImageType === $! && !(defined? ::GMagick::Image) ? '; install prawn-gmagick gem to add support' : ''}))
+ rescue => e
+ on_image_error :exception, node, target, (opts.merge message: %(could not embed image: #{image_path}; #{e.message}#{::Prawn::Errors::UnsupportedImageType === e && !(defined? ::GMagick::Image) ? '; install prawn-gmagick gem to add support' : ''}))
end
end