kamaci commented on a change in pull request #6939: Throw caught exception.
URL: https://github.com/apache/incubator-druid/pull/6939#discussion_r255415477
##########
File path: codestyle/checkstyle.xml
##########
@@ -204,6 +204,12 @@
<property name="message" value="Use
org.apache.druid.server.http.HttpMediaType#TEXT_PLAIN_UTF8 instead"/>
</module>
+ <module name="Regexp">
+ <property name="format" value='^((?!throw|=).)* Throwables.propagate\('/>
+ <property name="illegalPattern" value="true"/>
+ <property name="message" value="Throw caught exception"/>
Review comment:
I've updated my PR. However it fails at some tests for Exception type
mismatch i.e.
```
java.lang.AssertionError:
Expected: (an instance of org.apache.druid.query.QueryInterruptedException
and exception with cause an instance of java.util.concurrent.TimeoutException
and exception with message a string containing "Cannot acquire enough merge
buffers")
but: an instance of org.apache.druid.query.QueryInterruptedException
<java.lang.RuntimeException: java.lang.RuntimeException:
QueryInterruptedException{msg=Cannot acquire enough merge buffers, code=Query
timeout, class=java.util.concurrent.TimeoutException, host=null}> is a
java.lang.RuntimeException
Stacktrace was: java.lang.RuntimeException: java.lang.RuntimeException:
QueryInterruptedException{msg=Cannot acquire enough merge buffers, code=Query
timeout, class=java.util.concurrent.TimeoutException, host=null}
at
org.apache.druid.java.util.common.guava.WrappingSequence.accumulate(WrappingSequence.java:61)
at
org.apache.druid.java.util.common.guava.MappedSequence.accumulate(MappedSequence.java:43)
at
org.apache.druid.java.util.common.guava.Sequence.toList(Sequence.java:76)
at
org.apache.druid.query.groupby.GroupByQueryRunnerTestHelper.runQuery(GroupByQueryRunnerTestHelper.java:58)
at
```
So, should I fix the tests which checks for `RuntimeException` or `throw e`
for such cases @leventov ?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]