Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jgit-dev] JGit's overuse of IOException

Masaya Suzuki wrote:

I think you probably meant to quote p252 "Item 62: Document all exceptions thrown by each method". It says "Don't take the shortcut of declaring that a method throws some superclass of multiple exception classes that it can throw". I think the exception can inherit from this root exception for the caller's convenience, but still can specify the individual exceptions for each method. 

I really meant item 61, but you make a good point. A common superclass for JGit exceptions sounds harmless to me if JGit never uses it. :)

I suppose the clearest name for such a thing would be JGitException, since it would be used even by parts of the API, like config parsing, that don't involve a repository.

The main other API I like to look at as an example, Guava, doesn't have a common base class for its exceptions. Is there a reason callers that don't care about the particular exception type would need such a thing instead of using Exception?

Thanks,
Jonathan

Back to the top