better exception handling to reduce log bloating on appengine