On Apr 14, 10:47 am, Max A <[email protected]> wrote: > I thought you might say that. Still, wouldn't a valid paradigm be > > begin > model.update(stuff) > puts "Update successful" > rescue Sequel::ValidationError > puts "Update failure: validation problem" > puts model.errors.inspect > end > > work even for web apps? (with something smarter than "puts", of > course)
You can certainly handle it that way. Note that you'd still need to set raise_on_typecast_failure = false, otherwise if the user enters an invalid value in one of the fields, the exception raised is Sequel::InvalidValue, and the exception message probably doesn't have the context necessary to give a decent error message to the user. Jeremy --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "sequel-talk" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/sequel-talk?hl=en -~----------~----~----~----~------~----~------~--~---
