summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDan Allen <dan.j.allen@gmail.com>2021-05-07 23:43:05 -0600
committerDan Allen <dan.j.allen@gmail.com>2021-05-08 01:13:18 -0600
commit7fc921206eb93a97d7516331b384e1f627eb183f (patch)
tree4accc62fab13cdfad914814bfc3c57df08d3b175 /lib
parente429bbd6bbe389f8d9f840d9e093df7f978a29bd (diff)
use e as variable name for exception object rather than ex
Diffstat (limited to 'lib')
-rw-r--r--lib/asciidoctor/load.rb16
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/asciidoctor/load.rb b/lib/asciidoctor/load.rb
index e4b84d64..9825d35a 100644
--- a/lib/asciidoctor/load.rb
+++ b/lib/asciidoctor/load.rb
@@ -86,23 +86,23 @@ module Asciidoctor
timings.record :parse if timings
doc
- rescue => ex
+ rescue => e
begin
context = %(asciidoctor: FAILED: #{attrs['docfile'] || '<stdin>'}: Failed to load AsciiDoc document)
- if ex.respond_to? :exception
+ if e.respond_to? :exception
# The original message must be explicitly preserved when wrapping a Ruby exception
- wrapped_ex = ex.exception %(#{context} - #{ex.message})
+ wrapped_e = e.exception %(#{context} - #{e.message})
# JRuby automatically sets backtrace; MRI did not until 2.6
- wrapped_ex.set_backtrace ex.backtrace
+ wrapped_e.set_backtrace e.backtrace
else
# Likely a Java exception class
- wrapped_ex = ex.class.new context, ex
- wrapped_ex.stack_trace = ex.stack_trace
+ wrapped_e = e.class.new context, e
+ wrapped_e.stack_trace = e.stack_trace
end
rescue
- wrapped_ex = ex
+ wrapped_e = e
end
- raise wrapped_ex
+ raise wrapped_e
end
# Public: Parse the contents of the AsciiDoc source file into an Asciidoctor::Document