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