Plone views support setting return code on the HTTP response by mutation
http://collective-docs.readthedocs.org/en/latest/serving/http_request_and_response.html#return-code
… however does there exist anything Pyramid/Django style where one could return human-readable HTTP error codes from your browser view. Along the lines:
class View(BrowserView):
def __call__(self):
# Any nice classes to return here?
return Forbidden("Sauna area is forbidden due to on-going repairement work")
Also i am aware of that you can throw zException but that results to “We are sorry, there seems to be…” page on the user. I just want to short plain-text info to the browser.
No, apart from raising the zException built-in exceptions and calling
self.request.response.setStatus(), there is no other way for influencing the status code.