orf/simple — pull request #42 by Grimbox (2013-09-21 21:07:34+00:00)
Title: change 404 error handling when post is not found.

Hi again,

Just a small proposition for your "better exception" comment: I changed the type of caught exceptions to sqlalchemy.orm.exc.NoResultFoundException. With this, if .one() function fails because no result was found, the exception is raised and abort(404) is executed. If another exception is raised, it should be intercepted by Flask, which will then display the 500 error page.

Note that it's not mandatory to "return" before the abort() function, as mentioned here http://flask.pocoo.org/docs/quickstart/#redirects-and-errors .

Do you see anything else to improve this a little bit more?

Thanks !