Java Design Philosophy


Writing a Library

Exception

  1. Always throw exception as early as possible.

2. Hide detailed implementation exception from the upper caller. Always throw meaningful exceptions to caller (client)

IllegalArgumentException: the argument the caller passed to the library is incorrect.

IllegalStateException: something wrong with the internal library implementation.

 

 

Leave a comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.