Forums Register Login

find()-method and RecordNotFoundException

+Pie Number of slices to send: Send
DBMain.find method throws a RecordNotFoundException, Shall i through it to indicate no matched records are found, or shall I return an empty array.

+Pie Number of slices to send: Send
 

mohammad abdellatif wrote:Shall i through it to indicate no matched records are found


That's what I did. Others just returned an empty array. So both approaches are fine, don't forget to document your decision in choices.txt
No holds barred. And no bars holed. Except this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 846 times.
Similar Threads
[B&S] does update() need DuplicateKeyException
static method inside a abstract class?
implementing interface methods within another interface method
Javadoc: What to document if one exception is caught and another is throwed?
urlyBird 1.2.3 - findByCriteria method
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 10:34:21.