You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@accumulo.apache.org by GitBox <gi...@apache.org> on 2021/02/10 15:06:39 UTC

[GitHub] [accumulo] ctubbsii commented on pull request #1921: Better error message when instance.volumes does not specify the accumulo directory

ctubbsii commented on pull request #1921:
URL: https://github.com/apache/accumulo/pull/1921#issuecomment-776770843


   > Possibly. I followed what was in `VolumeManager` and that uses RTE. I'm fine with either but I am not sure they add anything to the error itself.
   
   More specific exceptions increase the caller's ability to handle them on a case-by-case basis. If a UI was designed to initialize and run Accumulo based on a user's input from a prompt for the volumes, for example, an IllegalArgumentException could be detected and cause the user to be prompted for a better value. A generic RuntimeException, on the other hand, would not imply any specific handling. So, a UI like I describe wouldn't be know whether to prompt for a new value, or do something else.
   
   In general, more specific exceptions are best, whenever possible. It's usually just a matter of finding the right one, or creating one that is appropriate. We probably have lots of existing generic RTE uses throughout our code, but I try to catch new ones in pull requests, and fix old ones, as we go, because it is better to be more specific whenever possible.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org