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
Post a Comment