Ralph Yozzo
Ralph Yozzo

Reputation: 1132

Testing the error_handlers in appengine

I added the following error handler in the app engine app.yaml file:

error_handlers:
- file: default_error.html

Then I planned to test it with a forced DeadlineExceededError

So I have a request handler:

class Timeout(webapp.RequestHandler):
  def get(self):
    count=100
    if self.request.get('count'):
        count=int(self.request.get('count'))
    time.sleep(count)

I call http://20-social.race-timing-failsafe.appspot.com/timeout?count=100 and I would expect my default_error.html file be displayed.

Instead I see:

A server error occurred.  Please contact the administrator.

Could this be caused by the artificial deadline exceeded via time.sleep. It seems to work for the syntax error case and "real" deadline exceeded messages (e.g., timeout when writing to datastore) and hopefully for quota exceeded.

What causes the A server error occurred. Please contact the administrator. message? And where is it coming from? I searched the google appengine sdk python code and did not find it.

Thanks.

Upvotes: 2

Views: 469

Answers (1)

Tim Hoffman
Tim Hoffman

Reputation: 12986

That error message isn't the raw Google one, so it looks like something else in your stack is trapping the exception and giving that response.

That default error handler is only served if an exception is not caught anywhere in your application.

e.g stick a raise StringError before you start any webapp stuff and see what happens ;-)

Upvotes: 1

Related Questions