python - User defined http status code on Google App Engine -


i have following handler gets content received request:

class dummyhandler(webapp2.requesthandler):     def get(self):         try:              msg = cgi.escape(self.request.get('content'))              if msg none:                 raise illegalcontent         except illegalcontent ex:             logging.error("illegal content received")             self.error(requesterrorcodes.illegal_content)         except exception ex:             logging.error(ex)              self.error(requesterrorcodes.unexpected_error) 

when run unittest, following error:

    self.error(requesterrorcodes.unexpected_error)   file "/applications/googleappenginelauncher.app/contents/resources/googleappengine-default.bundle/contents/resources/google_appengine/lib/webapp2/webapp2.py", line 582, in error     self.response.status = code attributeerror: can't set attribute 

i need define user specific error codes in http response client handle. supported in google app engine?


Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -