Throw exceptions when it's a "serious problem" that should halt page execution. Return an error object when it's a "routine event" that can be handled in the calling code and continue.
It seems to me you can do both with exceptions.
===
Purveyor of Doc Hope's [link|http://DocHope.com|fresh-baked dog biscuits and pet treats]. [link|http://DocHope.com|http://DocHope.com]
when the return value has an obvious "error mode", such as returning "" for file name (or -1 for collection size), and when the error _must_ be handled by the caller, return a value. If either of those conditions is not met, throw an exception.
--
And what are we doing when the two most powerful nations on earth -- America and Israel -- stomp on the elementary rights of human beings?
-- letter to the editor from W. Ostermeier, Liechtenstein
You can do both (or more accurately: either) with or without
Exceptions break the normal flow of control (by propagating outward), and should therefore be used when you want to break flow. When you don't want to, use a return value. It's common to see either approach being abused, but it's rarely a deal-breaker.