|
| 1 | +# |
| 2 | +# Copyright 2023 Balazs Scheidler |
| 3 | +# Copyright 2016 Google Inc. All rights reserved. |
| 4 | +# |
| 5 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | +# you may not use this file except in compliance with the License. |
| 7 | +# You may obtain a copy of the License at |
| 8 | +# |
| 9 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | +# |
| 11 | +# Unless required by applicable law or agreed to in writing, software |
| 12 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | +# See the License for the specific language governing permissions and |
| 15 | +# limitations under the License. |
| 16 | +# |
| 17 | +# The regular expressions were extracted from |
| 18 | +# https://github.com/GoogleCloudPlatform/fluent-plugin-detect-exceptions |
| 19 | +# and converted into a TSV format by Balazs Scheidler. |
| 20 | +# |
| 21 | +# List of tab separated fields |
| 22 | +# |
| 23 | +# comma-separated-states /regexp/ new_state |
| 24 | +# |
| 25 | + |
| 26 | +# java |
| 27 | +start_state,java_start_exception /(?:Exception|Error|Throwable|V8 errors stack trace)[:\r\n]/ java_after_exception |
| 28 | +java_after_exception /^[\t ]*nested exception is:[\t ]*/ java_start_exception |
| 29 | +java_after_exception /^[\r\n]*$/ java_after_exception |
| 30 | +java_after_exception,java /^[\t ]+(?:eval )?at / java |
| 31 | +java_after_exception,java /^[\t ]+--- End of inner exception stack trace ---$/ java |
| 32 | +java_after_exception,java /^--- End of stack trace from previous location where exception was thrown ---$/ java |
| 33 | +java_after_exception,java /^[\t ]*(?:Caused by|Suppressed):/ java_after_exception |
| 34 | +java_after_exception,java /^[\t ]*... \d+ (?:more|common frames omitted)/ java |
| 35 | + |
| 36 | +# python |
| 37 | +start_state /^Traceback \(most recent call last\):$/ python |
| 38 | +python /^[\t ]*File / python_code |
| 39 | +python_code /[^\t ]/ python |
| 40 | +python /^(?:[^\s.():]+\.)*[^\s.():]+:/ start_state |
| 41 | + |
| 42 | +# PHP |
| 43 | +start_state /(?:PHP\ (?:Notice|Parse\ error|Fatal\ error|Warning):)|(?:exception\ '[^']+'\ with\ message\ ')/ php_stack_begin |
| 44 | +php_stack_begin /^Stack trace:/ php_stack_frames |
| 45 | +php_stack_frames /^#\d/ php_stack_frames |
| 46 | +php_stack_frames /^\s+thrown in / start_state |
| 47 | + |
| 48 | +# Go |
| 49 | +start_state /\bpanic: / go_after_panic |
| 50 | +start_state /http: panic serving/ go_goroutine |
| 51 | +go_after_panic,go_after_signal,go_frame_1 /^$/ go_goroutine |
| 52 | +go_after_panic /^\[signal / go_after_signal |
| 53 | +go_goroutine /^goroutine \d+ \[[^\]]+\]:$/ go_frame_1 |
| 54 | +go_frame_1 /^(?:[^\s.:]+\.)*[^\s.():]+\(|^created by / go_frame_2 |
| 55 | +go_frame_2 /^\s/ go_frame_1 |
| 56 | + |
| 57 | +# Ruby |
| 58 | +start_state /Error \(.*\):$/ ruby_before_rails_trace |
| 59 | +ruby_before_rails_trace /^ $/ ruby |
| 60 | +ruby_before_rails_trace /^[\t ]+.*?\.rb:\d+:in `/ ruby |
| 61 | +ruby /^[\t ]+.*?\.rb:\d+:in `/ ruby |
| 62 | + |
| 63 | +# Dart |
| 64 | +start_state /^Unhandled exception:$/ dart_exc |
| 65 | +dart_exc /^(Instance of)|(Exception)|(Bad state)|(IntegerDivisionByZeroException)|(Invalid argument)|(RangeError)|(Assertion failed)|(Cannot instantiate)|(Reading static variable)|(UnimplementedError)|(Unsupported operation)|(Concurrent modification)|(Out of Memory)|(Stack Overflow)/ dart_stack |
| 66 | +dart_exc /^'.+?':.+?$/ dart_type_err_1 |
| 67 | +dart_type_err_1 /^#\d+\s+.+?\(.+?\)$/ dart_stack |
| 68 | +dart_type_err_1 /^.+?$/ dart_type_err_2 |
| 69 | +dart_type_err_2 /^.*?\^.*?$/ dart_type_err_3 |
| 70 | +dart_type_err_3 /^$/ dart_type_err_4 |
| 71 | +dart_type_err_4 /^$/ dart_stack |
| 72 | +dart_exc /^FormatException/ dart_format_err_1 |
| 73 | +dart_format_err_1 /^#\d+\s+.+?\(.+?\)$/ dart_stack |
| 74 | +dart_format_err_1 /^./ dart_format_err_2 |
| 75 | +dart_format_err_2 /^.*?\^/ dart_format_err_3 |
| 76 | +dart_format_err_3 /^$/ dart_stack |
| 77 | +dart_exc /^NoSuchMethodError:/ dart_method_err_1 |
| 78 | +dart_method_err_1 /^Receiver:/ dart_method_err_2 |
| 79 | +dart_method_err_2 /^Tried calling:/ dart_method_err_3 |
| 80 | +dart_method_err_3 /^Found:/ dart_stack |
| 81 | +dart_method_err_3 /^#\d+\s+.+?\(.+?\)$/ dart_stack |
| 82 | +dart_stack /^#\d+\s+.+?\(.+?\)$/ dart_stack |
| 83 | +dart_stack /^<asynchronous suspension>$/ dart_stack |
0 commit comments