I’m getting started learning Werkzeug. I see how to create a simple response:
def __call__(self, environ, start_response):
response = Response('hi there!')
return response(environ, start_response)
What’s the easiest way to construct an error response? That is, other than the message content itself! Is there some way to set the response to indicate that it is an error?
From the docs:
When constructing the Response object, you can specify a HTTP code to indicate an error back to the browser/user.