Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions lib/fluent/plugin/exception_detector.rb
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ def self.supported
:java_start_exception),
rule(:java_after_exception, /^[\r\n]*$/, :java_after_exception),
rule([:java_after_exception, :java], /^[\t ]+(?:eval )?at /, :java),
rule([:java_after_exception, :java], /^[\t ]+(?:eval )?|_ checkpoint /,
:java),

rule([:java_after_exception, :java],
# C# nested exception.
Expand All @@ -73,6 +75,10 @@ def self.supported

rule([:java_after_exception, :java], /^[\t ]*(?:Caused by|Suppressed):/,
:java_after_exception),
rule([:java_after_exception, :java],
/^(?:Error has been observed at the following site\(s\)):/,
:java),
rule([:java_after_exception, :java], /^(?:Stack trace):/, :java),
rule([:java_after_exception, :java],
/^[\t ]*... \d+ (?:more|common frames omitted)/, :java)
].freeze
Expand Down
23 changes: 23 additions & 0 deletions test/plugin/test_exception_detector.rb
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,28 @@ class ExceptionDetectorTest < Test::Unit::TestCase
Caused by: com.sun.mail.smtp.SMTPAddressFailedException: 550 5.7.1 <[REDACTED_EMAIL_ADDRESS]>... Relaying denied
END

REACTOR_JAVA_EXC = <<END.freeze
org.springframework.web.reactive.function.client.WebClientRequestException: finishConnect(..) failed: Connection refused: localhost:8080; nested exception is io.netty.channel.AbstractChannel$AnnotatedConnectException: finishConnect(..) failed: Connection refused: localhost:8080
at org.springframework.web.reactive.function.client.ExchangeFunctions$DefaultExchangeFunction.lambda$wrapException$9(ExchangeFunctions.java:141)
Suppressed: reactor.core.publisher.FluxOnAssembly$OnAssemblyException:
Error has been observed at the following site(s):
|_ checkpoint ⇢ Request to GET localhost:8080
Stack trace:
at org.springframework.web.reactive.function.client.ExchangeFunctions$DefaultExchangeFunction.lambda$wrapException$9(ExchangeFunctions.java:141)
at reactor.core.publisher.MonoErrorSupplied.subscribe(MonoErrorSupplied.java:70)
at reactor.core.publisher.Mono.subscribe(Mono.java:4150)
at reactor.core.publisher.FluxOnErrorResume$ResumeSubscriber.onError(FluxOnErrorResume.java:103)
at org.springframework.cloud.sleuth.instrument.reactor.ScopePassingSpanSubscriber.onError(ScopePassingSpanSubscriber.java:95)
at reactor.core.publisher.FluxPeek$PeekSubscriber.onError(FluxPeek.java:221)
at java.lang.Thread.run(Thread.java:834)
Caused by: io.netty.channel.AbstractChannel$AnnotatedConnectException: finishConnect(..) failed: Connection refused: localhost:8080
Caused by: java.net.ConnectException: finishConnect(..) failed: Connection refused
at io.netty.channel.unix.Errors.newConnectException0(Errors.java:155)
at io.netty.channel.unix.Errors.handleConnectErrno(Errors.java:128)
at io.netty.channel.unix.Socket.finishConnect(Socket.java:278)
at java.lang.Thread.run(Thread.java:834)
END

NODE_JS_EXC = <<END.freeze
ReferenceError: myArray is not defined
at next (/app/node_modules/express/lib/router/index.js:256:14)
Expand Down Expand Up @@ -607,6 +629,7 @@ def test_java
check_exception(JAVA_EXC, false)
check_exception(COMPLEX_JAVA_EXC, false)
check_exception(NESTED_JAVA_EXC, false)
check_exception(REACTOR_JAVA_EXC, false)
end

def test_js
Expand Down