• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Javadoc: What to document if one exception is caught and another is throwed?

 
Olena Golub
Ranch Hand
Posts: 113
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I am a little bit confused about correct documenting of the exception with javadoc.
If I have one method that catches one exception and throws another one, what is correct way to document it with javadoc?


Is it correct to document with @throws only RecordNotFoundException :


Thanks a lot for your help!
Regards,
Olena.
 
Lara McCarver
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That is how I would document it, but I would specifically mention that the RecordNotFoundException can be thrown due to an IOException.
 
Darya Akbari
Ranch Hand
Posts: 1855
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Olena,

I only provide a javadoc comment for the exception this method throws. As it is RecordNotFoundException in your case.

Regards,
Darya
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic