• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Ranch Hand
Posts: 113
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 1855
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic