mvime
mvime

Reputation: 337

How to make AppEngine display the error on the same page?

How can I make AppEngine show the errors from the log console in the page that I'm trying to load, so that I can avoid going to the log every time?

Upvotes: 1

Views: 174

Answers (2)

Nick Johnson
Nick Johnson

Reputation: 101149

If you're using the webapp or webapp2 frameworks, you can do this by adding debug=True to the WSGIApplication constructor.

Note that this is generally a bad idea, though, because it exposes internal details of your app to users, and presents them with a particularly unhelpful 500 page.

Upvotes: 0

Irfy
Irfy

Reputation: 9587

In general, you can catch all Errors, including syntax errors, with a catch-all (except:) clause of a try statement. If you can employ this tactic in your code and then show the exception in, for example, an alert message (or any other way), you got what you asked for.

Also, Have a look at this question and the accepted answer. If you override handle_exception as instructed there, you can put code that modifies the response to the request in a way you'd like.

Upvotes: 1

Related Questions