diff --git a/lib/fluent/plugin/exception_detector.rb b/lib/fluent/plugin/exception_detector.rb index 2d868bf..52ac28d 100644 --- a/lib/fluent/plugin/exception_detector.rb +++ b/lib/fluent/plugin/exception_detector.rb @@ -79,7 +79,7 @@ def self.supported PYTHON_RULES = [ rule(:start_state, /^Traceback \(most recent call last\):$/, :python), - rule(:python, /^[\t ]+File /, :python_code), + rule([:python, :python_code], /^[\t ]+File /, :python_code), rule(:python_code, /[^\t ]/, :python), rule(:python, /^(?:[^\s.():]+\.)*[^\s.():]+:/, :start_state) ].freeze diff --git a/test/plugin/test_exception_detector.rb b/test/plugin/test_exception_detector.rb index f001d0e..b2e77d1 100644 --- a/test/plugin/test_exception_detector.rb +++ b/test/plugin/test_exception_detector.rb @@ -132,6 +132,24 @@ class ExceptionDetectorTest < Test::Unit::TestCase File "/base/data/home/apps/s~nearfieldspy/1.378705245900539993/nearfieldspy.py", line 5, in get raise Exception('spam', 'eggs') Exception: ('spam', 'eggs') +END + + PYTHON_DOUBLE_FILE_EXC = <", line 1, in + File "/usr/local/lib/python3.6/site-packages/sqlalchemy/sql/type_api.py", line 66, in operate + return o[0](self.expr, op, *(other + o[1:]), **kwargs) + File "/usr/local/lib/python3.6/site-packages/sqlalchemy/sql/default_comparator.py", line 194, in _in_impl + for o in seq_or_selectable: +TypeError: 'NoneType' object is not iterable END PHP_EXC = <