paul-rogers commented on issue #1455: DRILL-6724: Convert IndexOutOfBounds 
exception to UserException with …
URL: https://github.com/apache/drill/pull/1455#issuecomment-418506296
 
 
   Note that is is, in general, very hard to test an exception such as these. 
We are catching programming errors. How does one trigger such exceptions? By 
running a test that finds a programming bug. What is the proper response? Fix 
the bug so that it never occurs again. This is why it is so hard to catch 
specific programming errors: by definition, they should never occur.
   
   However, if done at the fragment executor level, then Drill does have a way 
to trigger an exception using the error injection framework. Basically, pick a 
point in the code (perhaps in one of the readers) an call the error injector. 
If it is enabled, it will throw the requested exception. You can then verify 
that the error is as expected. And, since the error is intentionally injected, 
you can repeat this test as often as you like.
   
   Error handling is a tricky topic, which is why I'm jumping in to offer 
suggestions based on my time in "the school of hard knocks."

----------------------------------------------------------------
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

Reply via email to