fluent-plugin-detect-exceptions-with-webflux-support 0.0.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,990 @@
1
+ # Copyright 2016 Google Inc. All rights reserved.
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ require_relative '../helper'
16
+ require 'fluent/plugin/exception_detector'
17
+
18
+ class ExceptionDetectorTest < Test::Unit::TestCase
19
+ JAVA_EXC_PART1 = <<~END_JAVA_PART1.freeze
20
+ Jul 09, 2015 3:23:29 PM com.google.devtools.search.cloud.feeder.MakeLog: RuntimeException: Run from this message!
21
+ at com.my.app.Object.do$a1(MakeLog.java:50)
22
+ at java.lang.Thing.call(Thing.java:10)
23
+ END_JAVA_PART1
24
+
25
+ JAVA_EXC_PART2 = <<END_JAVA_PART2.freeze
26
+ at com.my.app.Object.help(MakeLog.java:40)
27
+ at sun.javax.API.method(API.java:100)
28
+ at com.jetty.Framework.main(MakeLog.java:30)
29
+ END_JAVA_PART2
30
+
31
+ JAVA_EXC = (JAVA_EXC_PART1 + JAVA_EXC_PART2).freeze
32
+
33
+ COMPLEX_JAVA_EXC = <<~END_COMPLEX_JAVA.freeze
34
+ javax.servlet.ServletException: Something bad happened
35
+ at com.example.myproject.OpenSessionInViewFilter.doFilter(OpenSessionInViewFilter.java:60)
36
+ at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
37
+ at com.example.myproject.ExceptionHandlerFilter.doFilter(ExceptionHandlerFilter.java:28)
38
+ at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
39
+ at com.example.myproject.OutputBufferFilter.doFilter(OutputBufferFilter.java:33)
40
+ at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
41
+ at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388)
42
+ at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
43
+ at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
44
+ at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
45
+ at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418)
46
+ at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
47
+ at org.mortbay.jetty.Server.handle(Server.java:326)
48
+ at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
49
+ at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:943)
50
+ at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:756)
51
+ at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218)
52
+ at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
53
+ at org.mortbay.jetty.bio.SocketConnector$Connection.run(SocketConnector.java:228)
54
+ at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)
55
+ Caused by: com.example.myproject.MyProjectServletException
56
+ at com.example.myproject.MyServlet.doPost(MyServlet.java:169)
57
+ at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
58
+ at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
59
+ at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
60
+ at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1166)
61
+ at com.example.myproject.OpenSessionInViewFilter.doFilter(OpenSessionInViewFilter.java:30)
62
+ ... 27 common frames omitted
63
+ END_COMPLEX_JAVA
64
+
65
+ NESTED_JAVA_EXC = <<~END_NESTED_JAVA.freeze
66
+ java.lang.RuntimeException: javax.mail.SendFailedException: Invalid Addresses;
67
+ nested exception is:
68
+ com.sun.mail.smtp.SMTPAddressFailedException: 550 5.7.1 <[REDACTED_EMAIL_ADDRESS]>... Relaying denied
69
+
70
+ at com.nethunt.crm.api.server.adminsync.AutomaticEmailFacade.sendWithSmtp(AutomaticEmailFacade.java:236)
71
+ at com.nethunt.crm.api.server.adminsync.AutomaticEmailFacade.sendSingleEmail(AutomaticEmailFacade.java:285)
72
+ at com.nethunt.crm.api.server.adminsync.AutomaticEmailFacade.lambda$sendSingleEmail$3(AutomaticEmailFacade.java:254)
73
+ at java.util.Optional.ifPresent(Optional.java:159)
74
+ at com.nethunt.crm.api.server.adminsync.AutomaticEmailFacade.sendSingleEmail(AutomaticEmailFacade.java:253)
75
+ at com.nethunt.crm.api.server.adminsync.AutomaticEmailFacade.sendSingleEmail(AutomaticEmailFacade.java:249)
76
+ at com.nethunt.crm.api.email.EmailSender.lambda$notifyPerson$0(EmailSender.java:80)
77
+ at com.nethunt.crm.api.util.ManagedExecutor.lambda$execute$0(ManagedExecutor.java:36)
78
+ at com.nethunt.crm.api.util.RequestContextActivator.lambda$withRequestContext$0(RequestContextActivator.java:36)
79
+ at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
80
+ at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
81
+ at java.base/java.lang.Thread.run(Thread.java:748)
82
+ Caused by: javax.mail.SendFailedException: Invalid Addresses;
83
+ nested exception is:
84
+ com.sun.mail.smtp.SMTPAddressFailedException: 550 5.7.1 <[REDACTED_EMAIL_ADDRESS]>... Relaying denied
85
+
86
+ at com.sun.mail.smtp.SMTPTransport.rcptTo(SMTPTransport.java:2064)
87
+ at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:1286)
88
+ at com.nethunt.crm.api.server.adminsync.AutomaticEmailFacade.sendWithSmtp(AutomaticEmailFacade.java:229)
89
+ ... 12 more
90
+ Caused by: com.sun.mail.smtp.SMTPAddressFailedException: 550 5.7.1 <[REDACTED_EMAIL_ADDRESS]>... Relaying denied
91
+ END_NESTED_JAVA
92
+
93
+ REACTOR_JAVA_EXC = <<~END_REACTOR_JAVA.freeze
94
+ org.springframework.web.reactive.function.client.WebClientRequestException: Failed to resolve 'non-existing-server' [A(1), AAAA(28)] after 6 queries ; nested exception is java.net.UnknownHostException: Failed to resolve 'non-existing-server' [A(1), AAAA(28)] after 6 queries
95
+ at org.springframework.web.reactive.function.client.ExchangeFunctions$DefaultExchangeFunction.lambda$wrapException$9(ExchangeFunctions.java:141) ~[spring-webflux-5.3.27.jar!/:5.3.27]
96
+ Suppressed: reactor.core.publisher.FluxOnAssembly$OnAssemblyException:
97
+ Error has been observed at the following site(s):
98
+ *__checkpoint ⇢ Request to GET null [DefaultWebClient]
99
+ *__checkpoint ⇢ Handler com.self.simpleSpringWebFlux.SimpleSpringWebFluxApplication#hello() [DispatcherHandler]
100
+ *__checkpoint ⇢ HTTP GET "/throwException" [ExceptionHandlingWebHandler]
101
+ Original Stack Trace:
102
+ at org.springframework.web.reactive.function.client.ExchangeFunctions$DefaultExchangeFunction.lambda$wrapException$9(ExchangeFunctions.java:141) ~[spring-webflux-5.3.27.jar!/:5.3.27]
103
+ at reactor.core.publisher.MonoErrorSupplied.subscribe(MonoErrorSupplied.java:55) ~[reactor-core-3.4.29.jar!/:3.4.29]
104
+ at reactor.core.publisher.Mono.subscribe(Mono.java:4490) ~[reactor-core-3.4.29.jar!/:3.4.29]
105
+ at reactor.core.publisher.FluxOnErrorResume$ResumeSubscriber.onError(FluxOnErrorResume.java:103) ~[reactor-core-3.4.29.jar!/:3.4.29]
106
+ at reactor.core.publisher.FluxPeek$PeekSubscriber.onError(FluxPeek.java:222) ~[reactor-core-3.4.29.jar!/:3.4.29]
107
+ at reactor.core.publisher.FluxPeek$PeekSubscriber.onError(FluxPeek.java:222) ~[reactor-core-3.4.29.jar!/:3.4.29]
108
+ at reactor.core.publisher.FluxPeek$PeekSubscriber.onError(FluxPeek.java:222) ~[reactor-core-3.4.29.jar!/:3.4.29]
109
+ at reactor.core.publisher.MonoNext$NextSubscriber.onError(MonoNext.java:93) ~[reactor-core-3.4.29.jar!/:3.4.29]
110
+ at reactor.core.publisher.MonoFlatMapMany$FlatMapManyMain.onError(MonoFlatMapMany.java:204) ~[reactor-core-3.4.29.jar!/:3.4.29]
111
+ at reactor.core.publisher.SerializedSubscriber.onError(SerializedSubscriber.java:124) ~[reactor-core-3.4.29.jar!/:3.4.29]
112
+ at reactor.core.publisher.FluxRetryWhen$RetryWhenMainSubscriber.whenError(FluxRetryWhen.java:225) ~[reactor-core-3.4.29.jar!/:3.4.29]
113
+ at reactor.core.publisher.FluxRetryWhen$RetryWhenOtherSubscriber.onError(FluxRetryWhen.java:274) ~[reactor-core-3.4.29.jar!/:3.4.29]
114
+ at reactor.core.publisher.FluxContextWrite$ContextWriteSubscriber.onError(FluxContextWrite.java:121) ~[reactor-core-3.4.29.jar!/:3.4.29]
115
+ at reactor.core.publisher.FluxConcatMap$ConcatMapImmediate.drain(FluxConcatMap.java:415) ~[reactor-core-3.4.29.jar!/:3.4.29]
116
+ at reactor.core.publisher.FluxConcatMap$ConcatMapImmediate.onNext(FluxConcatMap.java:251) ~[reactor-core-3.4.29.jar!/:3.4.29]
117
+ at reactor.core.publisher.FluxContextWrite$ContextWriteSubscriber.onNext(FluxContextWrite.java:107) ~[reactor-core-3.4.29.jar!/:3.4.29]
118
+ at reactor.core.publisher.EmitterProcessor.drain(EmitterProcessor.java:537) ~[reactor-core-3.4.29.jar!/:3.4.29]
119
+ at reactor.core.publisher.EmitterProcessor.tryEmitNext(EmitterProcessor.java:343) ~[reactor-core-3.4.29.jar!/:3.4.29]
120
+ at reactor.core.publisher.SinkManySerialized.tryEmitNext(SinkManySerialized.java:100) ~[reactor-core-3.4.29.jar!/:3.4.29]
121
+ at reactor.core.publisher.InternalManySink.emitNext(InternalManySink.java:27) ~[reactor-core-3.4.29.jar!/:3.4.29]
122
+ at reactor.core.publisher.FluxRetryWhen$RetryWhenMainSubscriber.onError(FluxRetryWhen.java:190) ~[reactor-core-3.4.29.jar!/:3.4.29]
123
+ at reactor.core.publisher.MonoCreate$DefaultMonoSink.error(MonoCreate.java:201) ~[reactor-core-3.4.29.jar!/:3.4.29]
124
+ at reactor.netty.http.client.HttpClientConnect$MonoHttpConnect$ClientTransportSubscriber.onError(HttpClientConnect.java:311) ~[reactor-netty-http-1.0.31.jar!/:1.0.31]
125
+ at reactor.core.publisher.MonoCreate$DefaultMonoSink.error(MonoCreate.java:201) ~[reactor-core-3.4.29.jar!/:3.4.29]
126
+ at reactor.netty.resources.DefaultPooledConnectionProvider$DisposableAcquire.onError(DefaultPooledConnectionProvider.java:160) ~[reactor-netty-core-1.0.31.jar!/:1.0.31]
127
+ at reactor.core.publisher.FluxContextWrite$ContextWriteSubscriber.onError(FluxContextWrite.java:121) ~[reactor-core-3.4.29.jar!/:3.4.29]
128
+ at reactor.netty.internal.shaded.reactor.pool.AbstractPool$Borrower.fail(AbstractPool.java:475) ~[reactor-netty-core-1.0.31.jar!/:1.0.31]
129
+ at reactor.netty.internal.shaded.reactor.pool.SimpleDequePool.lambda$drainLoop$9(SimpleDequePool.java:431) ~[reactor-netty-core-1.0.31.jar!/:1.0.31]
130
+ at reactor.core.publisher.FluxDoOnEach$DoOnEachSubscriber.onError(FluxDoOnEach.java:186) ~[reactor-core-3.4.29.jar!/:3.4.29]
131
+ at reactor.core.publisher.MonoCreate$DefaultMonoSink.error(MonoCreate.java:201) ~[reactor-core-3.4.29.jar!/:3.4.29]
132
+ at reactor.netty.resources.DefaultPooledConnectionProvider$PooledConnectionAllocator$PooledConnectionInitializer.onError(DefaultPooledConnectionProvider.java:558) ~[reactor-netty-core-1.0.31.jar!/:1.0.31]
133
+ at reactor.core.publisher.MonoFlatMap$FlatMapMain.secondError(MonoFlatMap.java:192) ~[reactor-core-3.4.29.jar!/:3.4.29]
134
+ at reactor.core.publisher.MonoFlatMap$FlatMapInner.onError(MonoFlatMap.java:259) ~[reactor-core-3.4.29.jar!/:3.4.29]
135
+ at reactor.core.publisher.FluxOnErrorResume$ResumeSubscriber.onError(FluxOnErrorResume.java:106) ~[reactor-core-3.4.29.jar!/:3.4.29]
136
+ at reactor.core.publisher.Operators.error(Operators.java:198) ~[reactor-core-3.4.29.jar!/:3.4.29]
137
+ at reactor.core.publisher.MonoError.subscribe(MonoError.java:53) ~[reactor-core-3.4.29.jar!/:3.4.29]
138
+ at reactor.core.publisher.Mono.subscribe(Mono.java:4490) ~[reactor-core-3.4.29.jar!/:3.4.29]
139
+ at reactor.core.publisher.FluxOnErrorResume$ResumeSubscriber.onError(FluxOnErrorResume.java:103) ~[reactor-core-3.4.29.jar!/:3.4.29]
140
+ at reactor.netty.transport.TransportConnector$MonoChannelPromise.tryFailure(TransportConnector.java:580) ~[reactor-netty-core-1.0.31.jar!/:1.0.31]
141
+ at reactor.netty.transport.TransportConnector.lambda$doResolveAndConnect$11(TransportConnector.java:387) ~[reactor-netty-core-1.0.31.jar!/:1.0.31]
142
+ at io.netty.util.concurrent.DefaultPromise.notifyListener0(DefaultPromise.java:590) ~[netty-common-4.1.91.Final.jar!/:4.1.91.Final]
143
+ at io.netty.util.concurrent.DefaultPromise.notifyListenersNow(DefaultPromise.java:557) ~[netty-common-4.1.91.Final.jar!/:4.1.91.Final]
144
+ at io.netty.util.concurrent.DefaultPromise.notifyListeners(DefaultPromise.java:492) ~[netty-common-4.1.91.Final.jar!/:4.1.91.Final]
145
+ at io.netty.util.concurrent.DefaultPromise.setValue0(DefaultPromise.java:636) ~[netty-common-4.1.91.Final.jar!/:4.1.91.Final]
146
+ at io.netty.util.concurrent.DefaultPromise.setFailure0(DefaultPromise.java:629) ~[netty-common-4.1.91.Final.jar!/:4.1.91.Final]
147
+ at io.netty.util.concurrent.DefaultPromise.setFailure(DefaultPromise.java:110) ~[netty-common-4.1.91.Final.jar!/:4.1.91.Final]
148
+ at io.netty.resolver.InetSocketAddressResolver$2.operationComplete(InetSocketAddressResolver.java:86) ~[netty-resolver-4.1.91.Final.jar!/:4.1.91.Final]
149
+ at io.netty.util.concurrent.DefaultPromise.notifyListener0(DefaultPromise.java:590) ~[netty-common-4.1.91.Final.jar!/:4.1.91.Final]
150
+ at io.netty.util.concurrent.DefaultPromise.notifyListeners0(DefaultPromise.java:583) ~[netty-common-4.1.91.Final.jar!/:4.1.91.Final]
151
+ at io.netty.util.concurrent.DefaultPromise.notifyListenersNow(DefaultPromise.java:559) ~[netty-common-4.1.91.Final.jar!/:4.1.91.Final]
152
+ at io.netty.util.concurrent.DefaultPromise.notifyListeners(DefaultPromise.java:492) ~[netty-common-4.1.91.Final.jar!/:4.1.91.Final]
153
+ at io.netty.util.concurrent.DefaultPromise.setValue0(DefaultPromise.java:636) ~[netty-common-4.1.91.Final.jar!/:4.1.91.Final]
154
+ at io.netty.util.concurrent.DefaultPromise.setFailure0(DefaultPromise.java:629) ~[netty-common-4.1.91.Final.jar!/:4.1.91.Final]
155
+ at io.netty.util.concurrent.DefaultPromise.tryFailure(DefaultPromise.java:118) ~[netty-common-4.1.91.Final.jar!/:4.1.91.Final]
156
+ at io.netty.resolver.dns.DnsResolveContext.finishResolve(DnsResolveContext.java:1096) ~[netty-resolver-dns-4.1.91.Final.jar!/:4.1.91.Final]
157
+ at io.netty.resolver.dns.DnsResolveContext.tryToFinishResolve(DnsResolveContext.java:1035) ~[netty-resolver-dns-4.1.91.Final.jar!/:4.1.91.Final]
158
+ at io.netty.resolver.dns.DnsResolveContext.query(DnsResolveContext.java:422) ~[netty-resolver-dns-4.1.91.Final.jar!/:4.1.91.Final]
159
+ at io.netty.resolver.dns.DnsResolveContext.onResponse(DnsResolveContext.java:655) ~[netty-resolver-dns-4.1.91.Final.jar!/:4.1.91.Final]
160
+ at io.netty.resolver.dns.DnsResolveContext.access$500(DnsResolveContext.java:66) ~[netty-resolver-dns-4.1.91.Final.jar!/:4.1.91.Final]
161
+ at io.netty.resolver.dns.DnsResolveContext$2.operationComplete(DnsResolveContext.java:482) ~[netty-resolver-dns-4.1.91.Final.jar!/:4.1.91.Final]
162
+ at io.netty.util.concurrent.DefaultPromise.notifyListener0(DefaultPromise.java:590) ~[netty-common-4.1.91.Final.jar!/:4.1.91.Final]
163
+ at io.netty.util.concurrent.DefaultPromise.notifyListeners0(DefaultPromise.java:583) ~[netty-common-4.1.91.Final.jar!/:4.1.91.Final]
164
+ at io.netty.util.concurrent.DefaultPromise.notifyListenersNow(DefaultPromise.java:559) ~[netty-common-4.1.91.Final.jar!/:4.1.91.Final]
165
+ at io.netty.util.concurrent.DefaultPromise.notifyListeners(DefaultPromise.java:492) ~[netty-common-4.1.91.Final.jar!/:4.1.91.Final]
166
+ at io.netty.util.concurrent.DefaultPromise.setValue0(DefaultPromise.java:636) ~[netty-common-4.1.91.Final.jar!/:4.1.91.Final]
167
+ at io.netty.util.concurrent.DefaultPromise.setSuccess0(DefaultPromise.java:625) ~[netty-common-4.1.91.Final.jar!/:4.1.91.Final]
168
+ at io.netty.util.concurrent.DefaultPromise.trySuccess(DefaultPromise.java:105) ~[netty-common-4.1.91.Final.jar!/:4.1.91.Final]
169
+ at io.netty.resolver.dns.DnsQueryContext.trySuccess(DnsQueryContext.java:232) ~[netty-resolver-dns-4.1.91.Final.jar!/:4.1.91.Final]
170
+ at io.netty.resolver.dns.DnsQueryContext.finish(DnsQueryContext.java:224) ~[netty-resolver-dns-4.1.91.Final.jar!/:4.1.91.Final]
171
+ at io.netty.resolver.dns.DnsNameResolver$DnsResponseHandler.channelRead(DnsNameResolver.java:1364) ~[netty-resolver-dns-4.1.91.Final.jar!/:4.1.91.Final]
172
+ at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444) ~[netty-transport-4.1.91.Final.jar!/:4.1.91.Final]
173
+ at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[netty-transport-4.1.91.Final.jar!/:4.1.91.Final]
174
+ at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) ~[netty-transport-4.1.91.Final.jar!/:4.1.91.Final]
175
+ at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103) ~[netty-codec-4.1.91.Final.jar!/:4.1.91.Final]
176
+ at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444) ~[netty-transport-4.1.91.Final.jar!/:4.1.91.Final]
177
+ at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[netty-transport-4.1.91.Final.jar!/:4.1.91.Final]
178
+ at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) ~[netty-transport-4.1.91.Final.jar!/:4.1.91.Final]
179
+ at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410) ~[netty-transport-4.1.91.Final.jar!/:4.1.91.Final]
180
+ at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:440) ~[netty-transport-4.1.91.Final.jar!/:4.1.91.Final]
181
+ at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[netty-transport-4.1.91.Final.jar!/:4.1.91.Final]
182
+ at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919) ~[netty-transport-4.1.91.Final.jar!/:4.1.91.Final]
183
+ at io.netty.channel.nio.AbstractNioMessageChannel$NioMessageUnsafe.read(AbstractNioMessageChannel.java:97) ~[netty-transport-4.1.91.Final.jar!/:4.1.91.Final]
184
+ at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:788) ~[netty-transport-4.1.91.Final.jar!/:4.1.91.Final]
185
+ at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:724) ~[netty-transport-4.1.91.Final.jar!/:4.1.91.Final]
186
+ at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:650) ~[netty-transport-4.1.91.Final.jar!/:4.1.91.Final]
187
+ at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:562) ~[netty-transport-4.1.91.Final.jar!/:4.1.91.Final]
188
+ at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997) ~[netty-common-4.1.91.Final.jar!/:4.1.91.Final]
189
+ at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) ~[netty-common-4.1.91.Final.jar!/:4.1.91.Final]
190
+ at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) ~[netty-common-4.1.91.Final.jar!/:4.1.91.Final]
191
+ at java.lang.Thread.run(Thread.java:748) ~[na:1.8.0_275]
192
+ Caused by: java.net.UnknownHostException: Failed to resolve 'non-existing-server' [A(1), AAAA(28)] after 6 queries
193
+ at io.netty.resolver.dns.DnsResolveContext.finishResolve(DnsResolveContext.java:1088) ~[netty-resolver-dns-4.1.91.Final.jar!/:4.1.91.Final]
194
+ at io.netty.resolver.dns.DnsResolveContext.tryToFinishResolve(DnsResolveContext.java:1035) ~[netty-resolver-dns-4.1.91.Final.jar!/:4.1.91.Final]
195
+ at io.netty.resolver.dns.DnsResolveContext.query(DnsResolveContext.java:422) ~[netty-resolver-dns-4.1.91.Final.jar!/:4.1.91.Final]
196
+ at io.netty.resolver.dns.DnsResolveContext.onResponse(DnsResolveContext.java:655) ~[netty-resolver-dns-4.1.91.Final.jar!/:4.1.91.Final]
197
+ at io.netty.resolver.dns.DnsResolveContext.access$500(DnsResolveContext.java:66) ~[netty-resolver-dns-4.1.91.Final.jar!/:4.1.91.Final]
198
+ at io.netty.resolver.dns.DnsResolveContext$2.operationComplete(DnsResolveContext.java:482) ~[netty-resolver-dns-4.1.91.Final.jar!/:4.1.91.Final]
199
+ at io.netty.util.concurrent.DefaultPromise.notifyListener0(DefaultPromise.java:590) ~[netty-common-4.1.91.Final.jar!/:4.1.91.Final]
200
+ at io.netty.util.concurrent.DefaultPromise.notifyListeners0(DefaultPromise.java:583) ~[netty-common-4.1.91.Final.jar!/:4.1.91.Final]
201
+ at io.netty.util.concurrent.DefaultPromise.notifyListenersNow(DefaultPromise.java:559) ~[netty-common-4.1.91.Final.jar!/:4.1.91.Final]
202
+ at io.netty.util.concurrent.DefaultPromise.notifyListeners(DefaultPromise.java:492) ~[netty-common-4.1.91.Final.jar!/:4.1.91.Final]
203
+ at io.netty.util.concurrent.DefaultPromise.setValue0(DefaultPromise.java:636) ~[netty-common-4.1.91.Final.jar!/:4.1.91.Final]
204
+ at io.netty.util.concurrent.DefaultPromise.setSuccess0(DefaultPromise.java:625) ~[netty-common-4.1.91.Final.jar!/:4.1.91.Final]
205
+ at io.netty.util.concurrent.DefaultPromise.trySuccess(DefaultPromise.java:105) ~[netty-common-4.1.91.Final.jar!/:4.1.91.Final]
206
+ at io.netty.resolver.dns.DnsQueryContext.trySuccess(DnsQueryContext.java:232) ~[netty-resolver-dns-4.1.91.Final.jar!/:4.1.91.Final]
207
+ at io.netty.resolver.dns.DnsQueryContext.finish(DnsQueryContext.java:224) ~[netty-resolver-dns-4.1.91.Final.jar!/:4.1.91.Final]
208
+ at io.netty.resolver.dns.DnsNameResolver$DnsResponseHandler.channelRead(DnsNameResolver.java:1364) ~[netty-resolver-dns-4.1.91.Final.jar!/:4.1.91.Final]
209
+ at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444) ~[netty-transport-4.1.91.Final.jar!/:4.1.91.Final]
210
+ at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[netty-transport-4.1.91.Final.jar!/:4.1.91.Final]
211
+ at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) ~[netty-transport-4.1.91.Final.jar!/:4.1.91.Final]
212
+ at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103) ~[netty-codec-4.1.91.Final.jar!/:4.1.91.Final]
213
+ at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444) ~[netty-transport-4.1.91.Final.jar!/:4.1.91.Final]
214
+ at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[netty-transport-4.1.91.Final.jar!/:4.1.91.Final]
215
+ at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) ~[netty-transport-4.1.91.Final.jar!/:4.1.91.Final]
216
+ at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410) ~[netty-transport-4.1.91.Final.jar!/:4.1.91.Final]
217
+ at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:440) ~[netty-transport-4.1.91.Final.jar!/:4.1.91.Final]
218
+ at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[netty-transport-4.1.91.Final.jar!/:4.1.91.Final]
219
+ at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919) ~[netty-transport-4.1.91.Final.jar!/:4.1.91.Final]
220
+ at io.netty.channel.nio.AbstractNioMessageChannel$NioMessageUnsafe.read(AbstractNioMessageChannel.java:97) ~[netty-transport-4.1.91.Final.jar!/:4.1.91.Final]
221
+ at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:788) ~[netty-transport-4.1.91.Final.jar!/:4.1.91.Final]
222
+ at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:724) ~[netty-transport-4.1.91.Final.jar!/:4.1.91.Final]
223
+ at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:650) ~[netty-transport-4.1.91.Final.jar!/:4.1.91.Final]
224
+ at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:562) ~[netty-transport-4.1.91.Final.jar!/:4.1.91.Final]
225
+ at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997) ~[netty-common-4.1.91.Final.jar!/:4.1.91.Final]
226
+ at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) ~[netty-common-4.1.91.Final.jar!/:4.1.91.Final]
227
+ at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) ~[netty-common-4.1.91.Final.jar!/:4.1.91.Final]
228
+ at java.lang.Thread.run(Thread.java:748) ~[na:1.8.0_275]
229
+ END_REACTOR_JAVA
230
+
231
+ NODE_JS_EXC = <<~END_NODE_JS.freeze
232
+ ReferenceError: myArray is not defined
233
+ at next (/app/node_modules/express/lib/router/index.js:256:14)
234
+ at /app/node_modules/express/lib/router/index.js:615:15
235
+ at next (/app/node_modules/express/lib/router/index.js:271:10)
236
+ at Function.process_params (/app/node_modules/express/lib/router/index.js:330:12)
237
+ at /app/node_modules/express/lib/router/index.js:277:22
238
+ at Layer.handle [as handle_request] (/app/node_modules/express/lib/router/layer.js:95:5)
239
+ at Route.dispatch (/app/node_modules/express/lib/router/route.js:112:3)
240
+ at next (/app/node_modules/express/lib/router/route.js:131:13)
241
+ at Layer.handle [as handle_request] (/app/node_modules/express/lib/router/layer.js:95:5)
242
+ at /app/app.js:52:3
243
+ END_NODE_JS
244
+
245
+ CLIENT_JS_EXC = <<~END_CLIENT_JS.freeze
246
+ Error
247
+ at bls (<anonymous>:3:9)
248
+ at <anonymous>:6:4
249
+ at a_function_name
250
+ at Object.InjectedScript._evaluateOn (http://<anonymous>/file.js?foo=bar:875:140)
251
+ at Object.InjectedScript.evaluate (<anonymous>)
252
+ END_CLIENT_JS
253
+
254
+ V8_JS_EXC = <<~END_V8_JS.freeze
255
+ V8 errors stack trace
256
+ eval at Foo.a (eval at Bar.z (myscript.js:10:3))
257
+ at new Contructor.Name (native)
258
+ at new FunctionName (unknown location)
259
+ at Type.functionName [as methodName] (file(copy).js?query='yes':12:9)
260
+ at functionName [as methodName] (native)
261
+ at Type.main(sample(copy).js:6:4)
262
+ END_V8_JS
263
+
264
+ PYTHON_EXC = <<~END_PYTHON.freeze
265
+ Traceback (most recent call last):
266
+ File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/webapp2-2.5.2/webapp2.py", line 1535, in __call__
267
+ rv = self.handle_exception(request, response, e)
268
+ File "/base/data/home/apps/s~nearfieldspy/1.378705245900539993/nearfieldspy.py", line 17, in start
269
+ return get()
270
+ File "/base/data/home/apps/s~nearfieldspy/1.378705245900539993/nearfieldspy.py", line 5, in get
271
+ raise Exception('spam', 'eggs')
272
+ Exception: ('spam', 'eggs')
273
+ END_PYTHON
274
+
275
+ PHP_EXC = <<~END_PHP.freeze
276
+ exception 'Exception' with message 'Custom exception' in /home/joe/work/test-php/test.php:5
277
+ Stack trace:
278
+ #0 /home/joe/work/test-php/test.php(9): func1()
279
+ #1 /home/joe/work/test-php/test.php(13): func2()
280
+ #2 {main}
281
+ END_PHP
282
+
283
+ PHP_ON_GAE_EXC = <<~END_PHP_ON_GAE.freeze
284
+ PHP Fatal error: Uncaught exception 'Exception' with message 'message' in /base/data/home/apps/s~crash-example-php/1.388306779641080894/errors.php:60
285
+ Stack trace:
286
+ #0 [internal function]: ErrorEntryGenerator::{closure}()
287
+ #1 /base/data/home/apps/s~crash-example-php/1.388306779641080894/errors.php(20): call_user_func_array(Object(Closure), Array)
288
+ #2 /base/data/home/apps/s~crash-example-php/1.388306779641080894/index.php(36): ErrorEntry->__call('raise', Array)
289
+ #3 /base/data/home/apps/s~crash-example-php/1.388306779641080894/index.php(36): ErrorEntry->raise()
290
+ #4 {main}
291
+ thrown in /base/data/home/apps/s~crash-example-php/1.388306779641080894/errors.php on line 60
292
+ END_PHP_ON_GAE
293
+
294
+ GO_EXC = <<~END_GO.freeze
295
+ panic: my panic
296
+
297
+ goroutine 4 [running]:
298
+ panic(0x45cb40, 0x47ad70)
299
+ /usr/local/go/src/runtime/panic.go:542 +0x46c fp=0xc42003f7b8 sp=0xc42003f710 pc=0x422f7c
300
+ main.main.func1(0xc420024120)
301
+ foo.go:6 +0x39 fp=0xc42003f7d8 sp=0xc42003f7b8 pc=0x451339
302
+ runtime.goexit()
303
+ /usr/local/go/src/runtime/asm_amd64.s:2337 +0x1 fp=0xc42003f7e0 sp=0xc42003f7d8 pc=0x44b4d1
304
+ created by main.main
305
+ foo.go:5 +0x58
306
+
307
+ goroutine 1 [chan receive]:
308
+ runtime.gopark(0x4739b8, 0xc420024178, 0x46fcd7, 0xc, 0xc420028e17, 0x3)
309
+ /usr/local/go/src/runtime/proc.go:280 +0x12c fp=0xc420053e30 sp=0xc420053e00 pc=0x42503c
310
+ runtime.goparkunlock(0xc420024178, 0x46fcd7, 0xc, 0x1000f010040c217, 0x3)
311
+ /usr/local/go/src/runtime/proc.go:286 +0x5e fp=0xc420053e70 sp=0xc420053e30 pc=0x42512e
312
+ runtime.chanrecv(0xc420024120, 0x0, 0xc420053f01, 0x4512d8)
313
+ /usr/local/go/src/runtime/chan.go:506 +0x304 fp=0xc420053f20 sp=0xc420053e70 pc=0x4046b4
314
+ runtime.chanrecv1(0xc420024120, 0x0)
315
+ /usr/local/go/src/runtime/chan.go:388 +0x2b fp=0xc420053f50 sp=0xc420053f20 pc=0x40439b
316
+ main.main()
317
+ foo.go:9 +0x6f fp=0xc420053f80 sp=0xc420053f50 pc=0x4512ef
318
+ runtime.main()
319
+ /usr/local/go/src/runtime/proc.go:185 +0x20d fp=0xc420053fe0 sp=0xc420053f80 pc=0x424bad
320
+ runtime.goexit()
321
+ /usr/local/go/src/runtime/asm_amd64.s:2337 +0x1 fp=0xc420053fe8 sp=0xc420053fe0 pc=0x44b4d1
322
+
323
+ goroutine 2 [force gc (idle)]:
324
+ runtime.gopark(0x4739b8, 0x4ad720, 0x47001e, 0xf, 0x14, 0x1)
325
+ /usr/local/go/src/runtime/proc.go:280 +0x12c fp=0xc42003e768 sp=0xc42003e738 pc=0x42503c
326
+ runtime.goparkunlock(0x4ad720, 0x47001e, 0xf, 0xc420000114, 0x1)
327
+ /usr/local/go/src/runtime/proc.go:286 +0x5e fp=0xc42003e7a8 sp=0xc42003e768 pc=0x42512e
328
+ runtime.forcegchelper()
329
+ /usr/local/go/src/runtime/proc.go:238 +0xcc fp=0xc42003e7e0 sp=0xc42003e7a8 pc=0x424e5c
330
+ runtime.goexit()
331
+ /usr/local/go/src/runtime/asm_amd64.s:2337 +0x1 fp=0xc42003e7e8 sp=0xc42003e7e0 pc=0x44b4d1
332
+ created by runtime.init.4
333
+ /usr/local/go/src/runtime/proc.go:227 +0x35
334
+
335
+ goroutine 3 [GC sweep wait]:
336
+ runtime.gopark(0x4739b8, 0x4ad7e0, 0x46fdd2, 0xd, 0x419914, 0x1)
337
+ /usr/local/go/src/runtime/proc.go:280 +0x12c fp=0xc42003ef60 sp=0xc42003ef30 pc=0x42503c
338
+ runtime.goparkunlock(0x4ad7e0, 0x46fdd2, 0xd, 0x14, 0x1)
339
+ /usr/local/go/src/runtime/proc.go:286 +0x5e fp=0xc42003efa0 sp=0xc42003ef60 pc=0x42512e
340
+ runtime.bgsweep(0xc42001e150)
341
+ /usr/local/go/src/runtime/mgcsweep.go:52 +0xa3 fp=0xc42003efd8 sp=0xc42003efa0 pc=0x419973
342
+ runtime.goexit()
343
+ /usr/local/go/src/runtime/asm_amd64.s:2337 +0x1 fp=0xc42003efe0 sp=0xc42003efd8 pc=0x44b4d1
344
+ created by runtime.gcenable
345
+ /usr/local/go/src/runtime/mgc.go:216 +0x58
346
+ END_GO
347
+
348
+ GO_ON_GAE_EXC = <<~END_GO_ON_GAE.freeze
349
+ panic: runtime error: index out of range
350
+
351
+ goroutine 12 [running]:
352
+ main88989.memoryAccessException()
353
+ crash_example_go.go:58 +0x12a
354
+ main88989.handler(0x2afb7042a408, 0xc01042f880, 0xc0104d3450)
355
+ crash_example_go.go:36 +0x7ec
356
+ net/http.HandlerFunc.ServeHTTP(0x13e5128, 0x2afb7042a408, 0xc01042f880, 0xc0104d3450)
357
+ go/src/net/http/server.go:1265 +0x56
358
+ net/http.(*ServeMux).ServeHTTP(0xc01045cab0, 0x2afb7042a408, 0xc01042f880, 0xc0104d3450)
359
+ go/src/net/http/server.go:1541 +0x1b4
360
+ appengine_internal.executeRequestSafely(0xc01042f880, 0xc0104d3450)
361
+ go/src/appengine_internal/api_prod.go:288 +0xb7
362
+ appengine_internal.(*server).HandleRequest(0x15819b0, 0xc010401560, 0xc0104c8180, 0xc010431380, 0x0, 0x0)
363
+ go/src/appengine_internal/api_prod.go:222 +0x102b
364
+ reflect.Value.call(0x1243fe0, 0x15819b0, 0x113, 0x12c8a20, 0x4, 0xc010485f78, 0x3, 0x3, 0x0, 0x0, ...)
365
+ /tmp/appengine/go/src/reflect/value.go:419 +0x10fd
366
+ reflect.Value.Call(0x1243fe0, 0x15819b0, 0x113, 0xc010485f78, 0x3, 0x3, 0x0, 0x0, 0x0)
367
+ /tmp/ap
368
+ END_GO_ON_GAE
369
+
370
+ GO_SIGNAL_EXC = <<~END_GO_SIGNAL.freeze
371
+ panic: runtime error: invalid memory address or nil pointer dereference
372
+ [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x7fd34f]
373
+
374
+ goroutine 5 [running]:
375
+ panics.nilPtrDereference()
376
+ panics/panics.go:33 +0x1f
377
+ panics.Wait()
378
+ panics/panics.go:16 +0x3b
379
+ created by main.main
380
+ server.go:20 +0x91
381
+ END_GO_SIGNAL
382
+
383
+ GO_HTTP = <<~END_GO_HTTP.freeze
384
+ 2019/01/15 07:48:05 http: panic serving [::1]:54143: test panic
385
+ goroutine 24 [running]:
386
+ net/http.(*conn).serve.func1(0xc00007eaa0)
387
+ /usr/local/go/src/net/http/server.go:1746 +0xd0
388
+ panic(0x12472a0, 0x12ece10)
389
+ /usr/local/go/src/runtime/panic.go:513 +0x1b9
390
+ main.doPanic(0x12f0ea0, 0xc00010e1c0, 0xc000104400)
391
+ /Users/ingvar/src/go/src/httppanic.go:8 +0x39
392
+ net/http.HandlerFunc.ServeHTTP(0x12be2e8, 0x12f0ea0, 0xc00010e1c0, 0xc000104400)
393
+ /usr/local/go/src/net/http/server.go:1964 +0x44
394
+ net/http.(*ServeMux).ServeHTTP(0x14a17a0, 0x12f0ea0, 0xc00010e1c0, 0xc000104400)
395
+ /usr/local/go/src/net/http/server.go:2361 +0x127
396
+ net/http.serverHandler.ServeHTTP(0xc000085040, 0x12f0ea0, 0xc00010e1c0, 0xc000104400)
397
+ /usr/local/go/src/net/http/server.go:2741 +0xab
398
+ net/http.(*conn).serve(0xc00007eaa0, 0x12f10a0, 0xc00008a780)
399
+ /usr/local/go/src/net/http/server.go:1847 +0x646
400
+ created by net/http.(*Server).Serve
401
+ /usr/local/go/src/net/http/server.go:2851 +0x2f5
402
+ END_GO_HTTP
403
+
404
+ CSHARP_EXC = <<~END_CSHARP.freeze
405
+ System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.
406
+ at System.Collections.Generic.Dictionary`2[System.String,System.Collections.Generic.Dictionary`2[System.Int32,System.Double]].get_Item (System.String key) [0x00000] in <filename unknown>:0
407
+ at File3.Consolidator_Class.Function5 (System.Collections.Generic.Dictionary`2 names, System.Text.StringBuilder param_4) [0x00007] in /usr/local/google/home/Csharp/another file.csharp:9
408
+ at File3.Consolidator_Class.Function4 (System.Text.StringBuilder param_4, System.Double[,,] array) [0x00013] in /usr/local/google/home/Csharp/another file.csharp:23
409
+ at File3.Consolidator_Class.Function3 (Int32 param_3) [0x0000f] in /usr/local/google/home/Csharp/another file.csharp:27
410
+ at File3.Consolidator_Class.Function3 (System.Text.StringBuilder param_3) [0x00007] in /usr/local/google/home/Csharp/another file.csharp:32
411
+ at File2.Processor.Function2 (System.Int32& param_2, System.Collections.Generic.Stack`1& numbers) [0x00003] in /usr/local/google/home/Csharp/File2.csharp:19
412
+ at File2.Processor.Random2 () [0x00037] in /usr/local/google/home/Csharp/File2.csharp:28
413
+ at File2.Processor.Function1 (Int32 param_1, System.Collections.Generic.Dictionary`2 map) [0x00007] in /usr/local/google/home/Csharp/File2.csharp:34
414
+ at Main.Welcome+<Main>c__AnonStorey0.<>m__0 () [0x00006] in /usr/local/google/home/Csharp/hello.csharp:48
415
+ at System.Threading.Thread.StartInternal () [0x00000] in <filename unknown>:0
416
+ END_CSHARP
417
+
418
+ CSHARP_NESTED_EXC = <<~END_CSHARP_NESTED.freeze
419
+ System.InvalidOperationException: This is the outer exception ---> System.InvalidOperationException: This is the inner exception
420
+ at ExampleApp.NestedExceptionExample.LowestLevelMethod() in c:/ExampleApp/ExampleApp/NestedExceptionExample.cs:line 33
421
+ at ExampleApp.NestedExceptionExample.ThirdLevelMethod() in c:/ExampleApp/ExampleApp/NestedExceptionExample.cs:line 28
422
+ at ExampleApp.NestedExceptionExample.SecondLevelMethod() in c:/ExampleApp/ExampleApp/NestedExceptionExample.cs:line 18
423
+ --- End of inner exception stack trace ---
424
+ at ExampleApp.NestedExceptionExample.SecondLevelMethod() in c:/ExampleApp/ExampleApp/NestedExceptionExample.cs:line 22
425
+ at ExampleApp.NestedExceptionExample.TopLevelMethod() in c:/ExampleApp/ExampleApp/NestedExceptionExample.cs:line 11
426
+ at ExampleApp.Program.Main(String[] args) in c:/ExampleApp/ExampleApp/Program.cs:line 11
427
+ END_CSHARP_NESTED
428
+
429
+ CSHARP_ASYNC_EXC = <<~END_CSHARP_ASYNC.freeze
430
+ System.InvalidOperationException: This is an exception
431
+ at ExampleApp2.AsyncExceptionExample.LowestLevelMethod() in c:/ExampleApp/ExampleApp/AsyncExceptionExample.cs:line 36
432
+ at ExampleApp2.AsyncExceptionExample.<ThirdLevelMethod>d__2.MoveNext() in c:/ExampleApp/ExampleApp/AsyncExceptionExample.cs:line 31
433
+ --- End of stack trace from previous location where exception was thrown ---
434
+ at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
435
+ at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
436
+ at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
437
+ at ExampleApp2.AsyncExceptionExample.<SecondLevelMethod>d__1.MoveNext() in c:/ExampleApp/ExampleApp/AsyncExceptionExample.cs:line 25
438
+ --- End of stack trace from previous location where exception was thrown ---
439
+ at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
440
+ at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
441
+ at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
442
+ at ExampleApp2.AsyncExceptionExample.<TopLevelMethod>d__0.MoveNext() in c:/ExampleApp/ExampleApp/AsyncExceptionExample.cs:line 14
443
+ END_CSHARP_ASYNC
444
+
445
+ RUBY_EXC = <<END_RUBY.freeze
446
+ NoMethodError (undefined method `resursivewordload' for #<BooksController:0x007f8dd9a0c738>):
447
+ app/controllers/books_controller.rb:69:in `recursivewordload'
448
+ app/controllers/books_controller.rb:75:in `loadword'
449
+ app/controllers/books_controller.rb:79:in `loadline'
450
+ app/controllers/books_controller.rb:83:in `loadparagraph'
451
+ app/controllers/books_controller.rb:87:in `loadpage'
452
+ app/controllers/books_controller.rb:91:in `onload'
453
+ app/controllers/books_controller.rb:95:in `loadrecursive'
454
+ app/controllers/books_controller.rb:99:in `requestload'
455
+ app/controllers/books_controller.rb:118:in `generror'
456
+ config/error_reporting_logger.rb:62:in `tagged'
457
+ END_RUBY
458
+
459
+ # The whitespace on the second line is significant.
460
+ # rubocop:disable Layout/TrailingWhitespace
461
+ RAILS_EXC = <<END_RAILS.freeze
462
+ ActionController::RoutingError (No route matches [GET] "/settings"):
463
+
464
+ actionpack (5.1.4) lib/action_dispatch/middleware/debug_exceptions.rb:63:in `call'
465
+ actionpack (5.1.4) lib/action_dispatch/middleware/show_exceptions.rb:31:in `call'
466
+ railties (5.1.4) lib/rails/rack/logger.rb:36:in `call_app'
467
+ railties (5.1.4) lib/rails/rack/logger.rb:24:in `block in call'
468
+ activesupport (5.1.4) lib/active_support/tagged_logging.rb:69:in `block in tagged'
469
+ activesupport (5.1.4) lib/active_support/tagged_logging.rb:26:in `tagged'
470
+ activesupport (5.1.4) lib/active_support/tagged_logging.rb:69:in `tagged'
471
+ railties (5.1.4) lib/rails/rack/logger.rb:24:in `call'
472
+ actionpack (5.1.4) lib/action_dispatch/middleware/remote_ip.rb:79:in `call'
473
+ actionpack (5.1.4) lib/action_dispatch/middleware/request_id.rb:25:in `call'
474
+ rack (2.0.3) lib/rack/method_override.rb:22:in `call'
475
+ rack (2.0.3) lib/rack/runtime.rb:22:in `call'
476
+ activesupport (5.1.4) lib/active_support/cache/strategy/local_cache_middleware.rb:27:in `call'
477
+ actionpack (5.1.4) lib/action_dispatch/middleware/executor.rb:12:in `call'
478
+ rack (2.0.3) lib/rack/sendfile.rb:111:in `call'
479
+ railties (5.1.4) lib/rails/engine.rb:522:in `call'
480
+ puma (3.10.0) lib/puma/configuration.rb:225:in `call'
481
+ puma (3.10.0) lib/puma/server.rb:605:in `handle_request'
482
+ puma (3.10.0) lib/puma/server.rb:437:in `process_client'
483
+ puma (3.10.0) lib/puma/server.rb:301:in `block in run'
484
+ puma (3.10.0) lib/puma/thread_pool.rb:120:in `block in spawn_thread'
485
+ END_RAILS
486
+ # rubocop:enable Layout/TrailingWhitespace
487
+
488
+ DART_ERR = <<~END_DART.freeze
489
+ Unhandled exception:
490
+ Instance of 'MyError'
491
+ #0 main.<anonymous closure> (file:///path/to/code/dartFile.dart:15:20)
492
+ #1 printError (file:///path/to/code/dartFile.dart:37:13)
493
+ #2 main (file:///path/to/code/dartFile.dart:15:3)
494
+ #3 _startIsolate.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:265)
495
+ #4 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:151)
496
+ END_DART
497
+
498
+ DART_EXC = <<~END_DART_EXC.freeze
499
+ Unhandled exception:
500
+ Exception: exception message
501
+ #0 main.<anonymous closure> (file:///path/to/code/dartFile.dart:17:20)
502
+ #1 printError (file:///path/to/code/dartFile.dart:37:13)
503
+ #2 main (file:///path/to/code/dartFile.dart:17:3)
504
+ #3 _startIsolate.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:265)
505
+ #4 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:151)
506
+ END_DART_EXC
507
+
508
+ DART_ASYNC_ERR = <<~END_DART_ASYNC.freeze
509
+ Unhandled exception:
510
+ Bad state: oops
511
+ #0 handleFailure (file:///test/example/http/handling_an_httprequest_error.dart:16:3)
512
+ #1 main (file:///test/example/http/handling_an_httprequest_error.dart:24:5)
513
+ <asynchronous suspension>
514
+ #2 _startIsolate.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:265)
515
+ #3 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:151)
516
+ END_DART_ASYNC
517
+
518
+ DART_DIVIDE_BY_ZERO_ERR = <<~END_DART_ZERO.freeze
519
+ Unhandled exception:
520
+ IntegerDivisionByZeroException
521
+ #0 main.<anonymous closure> (file:///path/to/code/dartFile.dart:27:20)
522
+ #1 printError (file:///path/to/code/dartFile.dart:42:13)
523
+ #2 main (file:///path/to/code/dartFile.dart:27:3)
524
+ #3 _startIsolate.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:265)
525
+ #4 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:151)
526
+ END_DART_ZERO
527
+
528
+ DART_ARGUMENT_ERR = <<~END_DART_ARG.freeze
529
+ Unhandled exception:
530
+ Invalid argument(s): invalid argument
531
+ #0 main.<anonymous closure> (file:///path/to/code/dartFile.dart:23:20)
532
+ #1 printError (file:///path/to/code/dartFile.dart:42:13)
533
+ #2 main (file:///path/to/code/dartFile.dart:23:3)
534
+ #3 _startIsolate.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:265)
535
+ #4 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:151)
536
+ END_DART_ARG
537
+
538
+ DART_RANGE_ERR = <<~END_DART_RANGE.freeze
539
+ Unhandled exception:
540
+ RangeError (index): Invalid value: Valid value range is empty: 1
541
+ #0 List.[] (dart:core-patch/growable_array.dart:151)
542
+ #1 main.<anonymous closure> (file:///path/to/code/dartFile.dart:31:23)
543
+ #2 printError (file:///path/to/code/dartFile.dart:42:13)
544
+ #3 main (file:///path/to/code/dartFile.dart:29:3)
545
+ #4 _startIsolate.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:265)
546
+ #5 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:151)
547
+ END_DART_RANGE
548
+
549
+ DART_ASSERTION_ERR = <<~END_DART_ASSERT.freeze
550
+ Unhandled exception:
551
+ Assertion failed
552
+ #0 main.<anonymous closure> (file:///path/to/code/dartFile.dart:9:20)
553
+ #1 printError (file:///path/to/code/dartFile.dart:36:13)
554
+ #2 main (file:///path/to/code/dartFile.dart:9:3)
555
+ #3 _startIsolate.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:265)
556
+ #4 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:151)
557
+ END_DART_ASSERT
558
+
559
+ DART_ABSTRACT_CLASS_ERR = <<~END_DART_ABC.freeze
560
+ Unhandled exception:
561
+ Cannot instantiate abstract class LNClassName: _url 'null' line null
562
+ #0 main.<anonymous closure> (file:///path/to/code/dartFile.dart:12:20)
563
+ #1 printError (file:///path/to/code/dartFile.dart:36:13)
564
+ #2 main (file:///path/to/code/dartFile.dart:12:3)
565
+ #3 _startIsolate.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:265)
566
+ #4 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:151)
567
+ END_DART_ABC
568
+
569
+ DART_READ_STATIC_ERR = <<~END_DART_STATIC.freeze
570
+ Unhandled exception:
571
+ Reading static variable 'variable' during its initialization
572
+ #0 main.<anonymous closure> (file:///path/to/code/dartFile.dart:28:20)
573
+ #1 printError (file:///path/to/code/dartFile.dart:43:13)
574
+ #2 main (file:///path/to/code/dartFile.dart:28:3)
575
+ #3 _startIsolate.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:265)
576
+ #4 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:151)
577
+ END_DART_STATIC
578
+
579
+ DART_UNIMPLEMENTED_ERROR = <<~END_DART_UNIMPL.freeze
580
+ Unhandled exception:
581
+ UnimplementedError: unimplemented
582
+ #0 main.<anonymous closure> (file:///path/to/code/dartFile.dart:38:20)
583
+ #1 printError (file:///path/to/code/dartFile.dart:61:13)
584
+ #2 main (file:///path/to/code/dartFile.dart:38:3)
585
+ #3 _startIsolate.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:265)
586
+ #4 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:151)
587
+ END_DART_UNIMPL
588
+
589
+ DART_UNSUPPORTED_ERR = <<~END_DART_UNSUPPORTED.freeze
590
+ Unhandled exception:
591
+ Unsupported operation: unsupported
592
+ #0 main.<anonymous closure> (file:///path/to/code/dartFile.dart:36:20)
593
+ #1 printError (file:///path/to/code/dartFile.dart:61:13)
594
+ #2 main (file:///path/to/code/dartFile.dart:36:3)
595
+ #3 _startIsolate.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:265)
596
+ #4 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:151)
597
+ END_DART_UNSUPPORTED
598
+
599
+ DART_CONCURRENT_MODIFICATION_ERR = <<~END_DART_CONCURRENT.freeze
600
+ Unhandled exception:
601
+ Concurrent modification during iteration.
602
+ #0 main.<anonymous closure> (file:///path/to/code/dartFile.dart:35:20)
603
+ #1 printError (file:///path/to/code/dartFile.dart:61:13)
604
+ #2 main (file:///path/to/code/dartFile.dart:35:3)
605
+ #3 _startIsolate.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:265)
606
+ #4 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:151)
607
+ END_DART_CONCURRENT
608
+
609
+ DART_OOM_ERR = <<~END_DART_OOM.freeze
610
+ Unhandled exception:
611
+ Out of Memory
612
+ #0 main.<anonymous closure> (file:///path/to/code/dartFile.dart:34:20)
613
+ #1 printError (file:///path/to/code/dartFile.dart:61:13)
614
+ #2 main (file:///path/to/code/dartFile.dart:34:3)
615
+ #3 _startIsolate.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:265)
616
+ #4 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:151)
617
+ END_DART_OOM
618
+
619
+ DART_STACK_OVERFLOW_ERR = <<~END_DART_STACK.freeze
620
+ Unhandled exception:
621
+ Stack Overflow
622
+ #0 main.<anonymous closure> (file:///path/to/code/dartFile.dart:33:20)
623
+ #1 printError (file:///path/to/code/dartFile.dart:61:13)
624
+ #2 main (file:///path/to/code/dartFile.dart:33:3)
625
+ #3 _startIsolate.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:265)
626
+ #4 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:151)
627
+ END_DART_STACK
628
+
629
+ DART_FALLTHROUGH_ERR = <<~END_DART_FALLTHROUGH.freeze
630
+ Unhandled exception:
631
+ 'null': Switch case fall-through at line null.
632
+ #0 main.<anonymous closure> (file:///path/to/code/dartFile.dart:39:20)
633
+ #1 printError (file:///path/to/code/dartFile.dart:51:13)
634
+ #2 main (file:///path/to/code/dartFile.dart:39:3)
635
+ #3 _startIsolate.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:265)
636
+ #4 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:151)
637
+ END_DART_FALLTHROUGH
638
+
639
+ DART_TYPE_ERR = <<~END_DART_TYPE.freeze
640
+ Unhandled exception:
641
+ 'file:///path/to/code/dartFile.dart': malformed type: line 7 pos 24: cannot resolve class 'NoType' from '::'
642
+ printError( () { new NoType(); } );
643
+ ^
644
+
645
+
646
+ #0 _TypeError._throwNew (dart:core-patch/errors_patch.dart:82)
647
+ #1 main.<anonymous closure> (file:///path/to/code/dartFile.dart:7:24)
648
+ #2 printError (file:///path/to/code/dartFile.dart:36:13)
649
+ #3 main (file:///path/to/code/dartFile.dart:7:3)
650
+ #4 _startIsolate.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:265)
651
+ #5 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:151)
652
+ END_DART_TYPE
653
+
654
+ DART_FORMAT_ERR = <<~END_DART_FORMAT.freeze
655
+ Unhandled exception:
656
+ FormatException: format exception
657
+ #0 main.<anonymous closure> (file:///path/to/code/dartFile.dart:25:20)
658
+ #1 printError (file:///path/to/code/dartFile.dart:42:13)
659
+ #2 main (file:///path/to/code/dartFile.dart:25:3)
660
+ #3 _startIsolate.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:265)
661
+ #4 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:151)
662
+ END_DART_FORMAT
663
+
664
+ DART_FORMAT_WITH_CODE_ERR = <<~END_DART_FORMAT_CODE.freeze
665
+ Unhandled exception:
666
+ FormatException: Invalid base64 data (at line 3, character 8)
667
+ this is not valid
668
+ ^
669
+
670
+ #0 main.<anonymous closure> (file:///path/to/code/dartFile.dart:24:20)
671
+ #1 printError (file:///path/to/code/dartFile.dart:42:13)
672
+ #2 main (file:///path/to/code/dartFile.dart:24:3)
673
+ #3 _startIsolate.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:265)
674
+ #4 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:151)
675
+ END_DART_FORMAT_CODE
676
+
677
+ DART_NO_METHOD_ERR = <<~END_DART_NO_METHOD.freeze
678
+ Unhandled exception:
679
+ NoSuchMethodError: No constructor 'TypeError' with matching arguments declared in class 'TypeError'.
680
+ Receiver: Type: class 'TypeError'
681
+ Tried calling: new TypeError("Invalid base64 data", "invalid", 36)
682
+ Found: new TypeError()
683
+ #0 NoSuchMethodError._throwNew (dart:core-patch/errors_patch.dart:196)
684
+ #1 main.<anonymous closure> (file:///path/to/code/dartFile.dart:8:39)
685
+ #2 printError (file:///path/to/code/dartFile.dart:36:13)
686
+ #3 main (file:///path/to/code/dartFile.dart:8:3)
687
+ #4 _startIsolate.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:265)
688
+ #5 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:151)
689
+ END_DART_NO_METHOD
690
+
691
+ DART_NO_METHOD_GLOBAL_ERR = <<~END_DART_NO_GLOBAL.freeze
692
+ Unhandled exception:
693
+ NoSuchMethodError: No top-level method 'noMethod' declared.
694
+ Receiver: top-level
695
+ Tried calling: noMethod()
696
+ #0 NoSuchMethodError._throwNew (dart:core-patch/errors_patch.dart:196)
697
+ #1 main.<anonymous closure> (file:///path/to/code/dartFile.dart:10:20)
698
+ #2 printError (file:///path/to/code/dartFile.dart:36:13)
699
+ #3 main (file:///path/to/code/dartFile.dart:10:3)
700
+ #4 _startIsolate.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:265)
701
+ #5 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:151)
702
+ END_DART_NO_GLOBAL
703
+
704
+ ARBITRARY_TEXT = <<~END_ARBITRARY.freeze
705
+ This arbitrary text.
706
+ It sounds tympanic: a word which means like a drum.
707
+
708
+ I am glad it contains no exception.
709
+ END_ARBITRARY
710
+
711
+ def check_multiline(detector, expected_first, expected_last, multiline)
712
+ lines = multiline.lines
713
+ lines.each_with_index do |line, index|
714
+ action = detector.update(line)
715
+ case index
716
+ when 0
717
+ assert_equal(expected_first, action,
718
+ "unexpected action on first line: #{line}")
719
+ when lines.length - 1
720
+ assert_equal(expected_last, action,
721
+ "unexpected action on last line: #{line}")
722
+ else
723
+ assert_equal(:inside_trace, action, "line not buffered: #{line}")
724
+ end
725
+ end
726
+ end
727
+
728
+ def check_no_multiline(detector, text)
729
+ text.lines.each do |line|
730
+ action = detector.update(line)
731
+ assert_equal(:no_trace, action, "unexpected action on line: #{line}")
732
+ end
733
+ end
734
+
735
+ def check_exception(exception, detects_end)
736
+ detector = Fluent::ExceptionDetector.new
737
+ after_exc = detects_end ? :end_trace : :inside_trace
738
+ before_second_exc = detects_end ? :inside_trace : :start_trace
739
+ check_multiline(detector, :no_trace, :no_trace, 'This is not an exception.')
740
+ check_multiline(detector, :inside_trace, after_exc, exception)
741
+ check_multiline(detector, :no_trace, :no_trace, 'This is not an exception.')
742
+ check_multiline(detector, :inside_trace, after_exc, exception)
743
+ check_multiline(detector, before_second_exc, after_exc, exception)
744
+ end
745
+
746
+ def test_java
747
+ check_exception(JAVA_EXC, false)
748
+ check_exception(COMPLEX_JAVA_EXC, false)
749
+ check_exception(NESTED_JAVA_EXC, false)
750
+ check_exception(REACTOR_JAVA_EXC, false)
751
+ end
752
+
753
+ def test_js
754
+ check_exception(NODE_JS_EXC, false)
755
+ check_exception(CLIENT_JS_EXC, false)
756
+ check_exception(V8_JS_EXC, false)
757
+ end
758
+
759
+ def test_csharp
760
+ check_exception(CSHARP_EXC, false)
761
+ check_exception(CSHARP_NESTED_EXC, false)
762
+ check_exception(CSHARP_ASYNC_EXC, false)
763
+ end
764
+
765
+ def test_python
766
+ check_exception(PYTHON_EXC, true)
767
+ end
768
+
769
+ def test_php
770
+ check_exception(PHP_EXC, false)
771
+ check_exception(PHP_ON_GAE_EXC, true)
772
+ end
773
+
774
+ def test_go
775
+ check_exception(GO_EXC, false)
776
+ check_exception(GO_ON_GAE_EXC, false)
777
+ check_exception(GO_SIGNAL_EXC, false)
778
+ check_exception(GO_HTTP, false)
779
+ end
780
+
781
+ def test_ruby
782
+ check_exception(RUBY_EXC, false)
783
+ check_exception(RAILS_EXC, false)
784
+ end
785
+
786
+ def test_dart
787
+ check_exception(DART_ERR, false)
788
+ check_exception(DART_EXC, false)
789
+ check_exception(DART_ASYNC_ERR, false)
790
+ check_exception(DART_DIVIDE_BY_ZERO_ERR, false)
791
+ check_exception(DART_ARGUMENT_ERR, false)
792
+ check_exception(DART_RANGE_ERR, false)
793
+ check_exception(DART_READ_STATIC_ERR, false)
794
+ check_exception(DART_UNIMPLEMENTED_ERROR, false)
795
+ check_exception(DART_UNSUPPORTED_ERR, false)
796
+ check_exception(DART_CONCURRENT_MODIFICATION_ERR, false)
797
+ check_exception(DART_OOM_ERR, false)
798
+ check_exception(DART_STACK_OVERFLOW_ERR, false)
799
+ check_exception(DART_FALLTHROUGH_ERR, false)
800
+ check_exception(DART_TYPE_ERR, false)
801
+ check_exception(DART_FORMAT_ERR, false)
802
+ check_exception(DART_FORMAT_WITH_CODE_ERR, false)
803
+ check_exception(DART_NO_METHOD_ERR, false)
804
+ check_exception(DART_NO_METHOD_GLOBAL_ERR, false)
805
+ check_exception(DART_ASSERTION_ERR, false)
806
+ check_exception(DART_ABSTRACT_CLASS_ERR, false)
807
+ end
808
+
809
+ def test_mixed_languages
810
+ check_exception(JAVA_EXC, false)
811
+ check_exception(PYTHON_EXC, true)
812
+ check_exception(COMPLEX_JAVA_EXC, false)
813
+ check_exception(NODE_JS_EXC, false)
814
+ check_exception(PHP_EXC, false)
815
+ check_exception(PHP_ON_GAE_EXC, true)
816
+ check_exception(CLIENT_JS_EXC, false)
817
+ check_exception(GO_EXC, false)
818
+ check_exception(GO_ON_GAE_EXC, false)
819
+ check_exception(GO_SIGNAL_EXC, false)
820
+ check_exception(CSHARP_EXC, false)
821
+ check_exception(CSHARP_NESTED_EXC, false)
822
+ check_exception(CSHARP_ASYNC_EXC, false)
823
+ check_exception(V8_JS_EXC, false)
824
+ check_exception(RUBY_EXC, false)
825
+ check_exception(DART_ERR, false)
826
+ check_exception(DART_EXC, false)
827
+ check_exception(DART_ASYNC_ERR, false)
828
+ check_exception(DART_DIVIDE_BY_ZERO_ERR, false)
829
+ check_exception(DART_ARGUMENT_ERR, false)
830
+ check_exception(DART_RANGE_ERR, false)
831
+ check_exception(DART_READ_STATIC_ERR, false)
832
+ check_exception(DART_UNIMPLEMENTED_ERROR, false)
833
+ check_exception(DART_UNSUPPORTED_ERR, false)
834
+ check_exception(DART_CONCURRENT_MODIFICATION_ERR, false)
835
+ check_exception(DART_OOM_ERR, false)
836
+ check_exception(DART_STACK_OVERFLOW_ERR, false)
837
+ check_exception(DART_FALLTHROUGH_ERR, false)
838
+ check_exception(DART_TYPE_ERR, false)
839
+ check_exception(DART_FORMAT_ERR, false)
840
+ check_exception(DART_FORMAT_WITH_CODE_ERR, false)
841
+ check_exception(DART_NO_METHOD_ERR, false)
842
+ check_exception(DART_NO_METHOD_GLOBAL_ERR, false)
843
+ check_exception(DART_ASSERTION_ERR, false)
844
+ check_exception(DART_ABSTRACT_CLASS_ERR, false)
845
+ end
846
+
847
+ def test_reset
848
+ detector = Fluent::ExceptionDetector.new
849
+
850
+ check_multiline(detector, :inside_trace, :inside_trace, JAVA_EXC_PART1)
851
+ check_multiline(detector, :inside_trace, :inside_trace, JAVA_EXC_PART2)
852
+
853
+ check_multiline(detector, :start_trace, :inside_trace, JAVA_EXC_PART1)
854
+ detector.reset
855
+ check_no_multiline(detector, JAVA_EXC_PART2)
856
+ end
857
+
858
+ def feed_lines(buffer, *messages)
859
+ messages.each do |m|
860
+ m.each_line do |line|
861
+ buffer.push(0, line)
862
+ end
863
+ buffer.flush
864
+ end
865
+ end
866
+
867
+ Struct.new('TestBufferScenario', :desc, :languages, :input, :expected)
868
+
869
+ def buffer_scenario(desc, languages, input, expected)
870
+ Struct::TestBufferScenario.new(desc, languages, input, expected)
871
+ end
872
+
873
+ def test_buffer
874
+ [
875
+ buffer_scenario('mixed languages',
876
+ [:all],
877
+ [JAVA_EXC, ARBITRARY_TEXT, PYTHON_EXC, GO_EXC],
878
+ [JAVA_EXC] + ARBITRARY_TEXT.lines + [PYTHON_EXC, GO_EXC]),
879
+ buffer_scenario('single language',
880
+ [:go],
881
+ [JAVA_EXC, ARBITRARY_TEXT, GO_EXC],
882
+ JAVA_EXC.lines + ARBITRARY_TEXT.lines + [GO_EXC]),
883
+ buffer_scenario('some exceptions from non-configured languages',
884
+ [:python],
885
+ [JAVA_EXC, PYTHON_EXC, GO_EXC],
886
+ JAVA_EXC.lines + [PYTHON_EXC] + GO_EXC.lines),
887
+ buffer_scenario('all exceptions from non-configured languages',
888
+ [:ruby],
889
+ [JAVA_EXC, PYTHON_EXC, GO_EXC],
890
+ JAVA_EXC.lines + PYTHON_EXC.lines + GO_EXC.lines)
891
+ ].each do |s|
892
+ out = []
893
+ buffer = Fluent::TraceAccumulator.new(nil,
894
+ s.languages) { |_, m| out << m }
895
+ feed_lines(buffer, *s.input)
896
+ assert_equal(s.expected, out, s.desc)
897
+ end
898
+ end
899
+
900
+ def feed_json(buffer, message_field, messages)
901
+ messages.each do |m|
902
+ m.each_line do |line|
903
+ buffer.push(0, message_field => line)
904
+ end
905
+ buffer.flush
906
+ end
907
+ end
908
+
909
+ def expected_json(message_field, messages)
910
+ messages.collect { |m| { message_field => [m].flatten.join } }
911
+ end
912
+
913
+ Struct.new('TestJsonScenario',
914
+ :desc, :configured_field, :actual_field, :input, :output)
915
+
916
+ def json_scenario(desc, configured_field, actual_field, input, output)
917
+ Struct::TestJsonScenario.new(desc, configured_field, actual_field,
918
+ input, output)
919
+ end
920
+
921
+ def test_json_messages
922
+ [
923
+ json_scenario('User-defined message field', 'mydata', 'mydata',
924
+ [PYTHON_EXC, ARBITRARY_TEXT, GO_EXC],
925
+ [PYTHON_EXC] + ARBITRARY_TEXT.lines + [GO_EXC]),
926
+ json_scenario('Default message field "message"', '', 'message',
927
+ [PYTHON_EXC, ARBITRARY_TEXT, GO_EXC],
928
+ [PYTHON_EXC] + ARBITRARY_TEXT.lines + [GO_EXC]),
929
+ json_scenario('Default message field "log"', '', 'log',
930
+ [PYTHON_EXC, ARBITRARY_TEXT, GO_EXC],
931
+ [PYTHON_EXC] + ARBITRARY_TEXT.lines + [GO_EXC]),
932
+ json_scenario('Wrongly defined message field', 'doesnotexist', 'mydata',
933
+ [PYTHON_EXC, ARBITRARY_TEXT, GO_EXC],
934
+ PYTHON_EXC.lines + ARBITRARY_TEXT.lines + GO_EXC.lines),
935
+ json_scenario('Undefined message field', '', 'mydata',
936
+ [PYTHON_EXC, ARBITRARY_TEXT, GO_EXC],
937
+ PYTHON_EXC.lines + ARBITRARY_TEXT.lines + GO_EXC.lines)
938
+ ].each do |s|
939
+ out = []
940
+ buffer = Fluent::TraceAccumulator.new(s.configured_field,
941
+ [:all]) { |_, m| out << m }
942
+ feed_json(buffer, s.actual_field, s.input)
943
+ assert_equal(expected_json(s.actual_field, s.output), out, s.desc)
944
+ end
945
+ end
946
+
947
+ def test_max_lines_limit
948
+ # Limit is equal to the first part of the exception and forces it to be
949
+ # flushed before the rest of the exception is processed.
950
+ max_lines = JAVA_EXC_PART1.lines.length
951
+ out = []
952
+ buffer = Fluent::TraceAccumulator.new(nil,
953
+ [:all],
954
+ max_lines: max_lines) do |_, m|
955
+ out << m
956
+ end
957
+ feed_lines(buffer, JAVA_EXC)
958
+ assert_equal([JAVA_EXC_PART1] + JAVA_EXC_PART2.lines, out)
959
+ end
960
+
961
+ def test_high_max_bytes_limit
962
+ # Limit is just too small to add one more line to the buffered first part of
963
+ # the exception.
964
+ max_bytes = JAVA_EXC_PART1.length + JAVA_EXC_PART2.lines[0].length - 1
965
+ out = []
966
+ buffer = Fluent::TraceAccumulator.new(nil,
967
+ [:all],
968
+ max_bytes: max_bytes) do |_, m|
969
+ out << m
970
+ end
971
+ feed_lines(buffer, JAVA_EXC)
972
+ # Check that the trace is flushed after the first part.
973
+ assert_equal([JAVA_EXC_PART1] + JAVA_EXC_PART2.lines, out)
974
+ end
975
+
976
+ def test_low_max_bytes_limit
977
+ # Limit is exceeded by the character that follows the buffered first part of
978
+ # the exception.
979
+ max_bytes = JAVA_EXC_PART1.length
980
+ out = []
981
+ buffer = Fluent::TraceAccumulator.new(nil,
982
+ [:all],
983
+ max_bytes: max_bytes) do |_, m|
984
+ out << m
985
+ end
986
+ feed_lines(buffer, JAVA_EXC)
987
+ # Check that the trace is flushed after the first part.
988
+ assert_equal([JAVA_EXC_PART1] + JAVA_EXC_PART2.lines, out)
989
+ end
990
+ end