On Jan 26, 3:52 am, Boda Cydo <[email protected]> wrote: > Hello all! > > I have a question about handling errors in SQLAlchemy. > > Before I used SQLAlchemy I used to rigorously check for all errors > when executing queries, like: > > > status = db.query("INSERT INTO users ...") > > if !status: > > handle_insert_error() > > But now when I have switched to SQLAlchemy I write code with no error > checking whatsoever, like: > > > user = User("Boda Cydo") > > session.add(user) > > session.commit() > > And I do absolutely no error checking. I absolutely feel horrible for > writing such code. > > I talked in #sqlalchemy and someone told me that SQLAlchemy throws > exceptions on errors. That's better. But where is it documented? The > person couldn't find anything. Neither could I. > > Can anyone please help with tips (or point me to documentation) about > what exceptions get raised when? > > I absolutely don't want to write code without error handling. > > Thanks, > Boda Cydo
I asked it on Stackoverflow and got a great answer! Here it is: http://stackoverflow.com/questions/2136739/error-handling-in-sqlalchemy Boda Cydo -- You received this message because you are subscribed to the Google Groups "sqlalchemy" 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/sqlalchemy?hl=en.
