armeria
armeria copied to clipboard
Show more stack trace of CompositeException
Motivation:
If one or more exceptions are raised just show 1 stack trace in Exception Overview.
This can be very inconvenient.
So we may need to increase the number of lines in the output stacktrace. (20 is sensible default?)
and show full stack trace when
-Dcom.linecorp.armeria.verboseExceptions=true
Modifications:
- if
-Dcom.linecorp.armeria.verboseExceptions=true
, I increased the number of output lines of the stacktrace. - If the stacktrace line is lower than the
maxStacktraceSize
, a lower line is output.
Result:
- Closes #4347
Caused by: com.linecorp.armeria.common.util.CompositeException: 2 exceptions occurred.
at app//com.linecorp.armeria.internal.common.stream.RecoverableStreamMessage$RecoverableSubscriber.onError(RecoverableStreamMessage.java:226)
at app//com.linecorp.armeria.internal.common.stream.AbortedStreamMessage.subscribe0(AbortedStreamMessage.java:91)
at app//com.linecorp.armeria.internal.common.stream.AbortedStreamMessage.lambda$subscribe$1(AbortedStreamMessage.java:85)
at app//io.netty.util.concurrent.AbstractEventExecutor.runTask(AbstractEventExecutor.java:174)
at app//io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:167)
at app//io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:470)
at app//io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:503)
at app//io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997)
at app//io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
at app//io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
at [email protected]/java.lang.Thread.run(Thread.java:833)
Caused by: com.linecorp.armeria.common.util.CompositeException$ExceptionOverview: Multiple exceptions (2)
|-- java.lang.NullPointerException: null
at com.linecorp.armeria.common.util.CompositeExceptionTest.lambda$verboseExceptionOptionDisabledTest$1(CompositeExceptionTest.java:73)
at com.linecorp.armeria.internal.common.stream.RecoverableStreamMessage$RecoverableSubscriber.onError(RecoverableStreamMessage.java:221)
at com.linecorp.armeria.internal.common.stream.AbortedStreamMessage.subscribe0(AbortedStreamMessage.java:91)
at com.linecorp.armeria.internal.common.stream.AbortedStreamMessage.lambda$subscribe$1(AbortedStreamMessage.java:85)
at io.netty.util.concurrent.AbstractEventExecutor.runTask(AbstractEventExecutor.java:174)
at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:167)
at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:470)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:503)
at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997)
at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
at java.base/java.lang.Thread.run(Thread.java:833)
|-- java.lang.IllegalArgumentException: null
at com.linecorp.armeria.common.util.CompositeExceptionTest.verboseExceptionOptionDisabledTest(CompositeExceptionTest.java:72)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at org.junit.platform.commons.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:725)
at org.junit.jupiter.engine.execution.MethodInvocation.proceed(MethodInvocation.java:60)
at org.junit.jupiter.engine.execution.InvocationInterceptorChain$ValidatingInvocation.proceed(InvocationInterceptorChain.java:131)
at org.junit.jupiter.engine.extension.TimeoutInvocation.proceed(TimeoutInvocation.java:46)
at org.junit.jupiter.engine.extension.TimeoutExtension.intercept(TimeoutExtension.java:149)
at org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestableMethod(TimeoutExtension.java:140)
at org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestMethod(TimeoutExtension.java:84)
at org.junit.jupiter.engine.execution.ExecutableInvoker$ReflectiveInterceptorCall.lambda$ofVoidMethod$0(ExecutableInvoker.java:115)
at org.junit.jupiter.engine.execution.ExecutableInvoker.lambda$invoke$0(ExecutableInvoker.java:105)
at org.junit.jupiter.engine.execution.InvocationInterceptorChain$InterceptedInvocation.proceed(InvocationInterceptorChain.java:106)
at org.junit.jupiter.engine.execution.InvocationInterceptorChain.proceed(InvocationInterceptorChain.java:64)
at org.junit.jupiter.engine.execution.InvocationInterceptorChain.chainAndInvoke(InvocationInterceptorChain.java:45)
at org.junit.jupiter.engine.execution.InvocationInterceptorChain.invoke(InvocationInterceptorChain.java:37)
at org.junit.jupiter.engine.execution.ExecutableInvoker.invoke(ExecutableInvoker.java:104)
at org.junit.jupiter.engine.execution.ExecutableInvoker.invoke(ExecutableInvoker.java:98)
Codecov Report
Merging #4356 (40f74c8) into master (7741676) will increase coverage by
0.44%
. The diff coverage is88.23%
.
@@ Coverage Diff @@
## master #4356 +/- ##
============================================
+ Coverage 73.53% 73.98% +0.44%
- Complexity 17644 17911 +267
============================================
Files 1500 1520 +20
Lines 65990 66561 +571
Branches 8325 8371 +46
============================================
+ Hits 48528 49246 +718
- Misses 13254 13290 +36
+ Partials 4208 4025 -183
Impacted Files | Coverage Δ | |
---|---|---|
...necorp/armeria/common/util/CompositeException.java | 45.94% <88.23%> (+2.13%) |
:arrow_up: |
...ria/internal/common/grpc/GrpcExchangeTypeUtil.java | 50.00% <0.00%> (-40.00%) |
:arrow_down: |
...corp/armeria/common/grpc/StatusCauseException.java | 72.22% <0.00%> (-27.78%) |
:arrow_down: |
.../armeria/server/grpc/UnframedGrpcErrorHandler.java | 66.66% <0.00%> (-23.17%) |
:arrow_down: |
...server/grpc/UnframedGrpcStatusMappingFunction.java | 77.77% <0.00%> (-22.23%) |
:arrow_down: |
.../com/linecorp/armeria/common/util/Unwrappable.java | 83.33% <0.00%> (-16.67%) |
:arrow_down: |
...com/linecorp/armeria/common/metric/MoreMeters.java | 78.75% <0.00%> (-8.75%) |
:arrow_down: |
...eria/internal/common/stream/StreamMessageUtil.java | 61.11% <0.00%> (-5.56%) |
:arrow_down: |
...va/com/linecorp/armeria/server/docs/FieldInfo.java | 60.52% <0.00%> (-3.37%) |
:arrow_down: |
... and 319 more |
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.
Still LGTM