Error handling practises with methods that return collections
If I am trying to get an element from a collection (and the value must be there), what is the best course of action? Return null?

Also, if I am trying to get an element from a collection but the value is not there (and does not strictly have to be there, ie its not fatal) what is the best course of action?


And lastly if a collection is returned from a method and that is empty, I am guessing that the best course of aciton is throw an exception if it is fatal and otherwise do not.


Thanks
Error handling practises with methods that return collections
===

If I am trying to get an element from a collection (and the value must be there), what is the best course of action? Return null?

Also, if I am trying to get an element from a collection but the value is not there (and does not strictly have to be there, ie its not fatal) what is the best course of action?


And lastly if a collection is returned from a method and that is empty, I am guessing that the best course of aciton is throw an exception if it is fatal and otherwise do not.


Thanks