Best practice: raise an exception or return false

just wondering how others deal with invalid/illegal operations on their

until now, I’ve simply been returning true or false depending on wether
not the operation succeeded, but that doesn’t tell the calling function
the operation failed (if it failed).

I could use custom exceptions, but is it good practice to raise an
on every invalid action or just the more serious ones? where’s the best
place to store custom exceptions? I’m thinking model specific ones in
model file itself and generic ones in environment.rb…?

how do others deal with this?

Raise exceptions. They’re much harder miss. :slight_smile:

– Tom M.

+1 for exceptions. It forces you to handle the errors.