title: Return a Message with HTTP Error Response Code in Flask?
body: <p><strong>How can a message body be added to a 404 response in flask?</strong>  </p>
  
  <p>The following attempts will generate a 404 but without the message:</p>
  
  <pre><code>@app.route('/fruit/&lt;fruit_name&gt;', methods=["GET"])
  def fruit_route(fruit_name):
      if fruit_name == "tomato":
          return "I don't care what they say, tomato is not a fruit", 404
  
      return "yummy"
  
  @app.route('/fruit/&lt;fruit_name&gt;', methods=["GET"])
  def fruit_route(fruit_name):
      if fruit_name == "tomato":
          flask.abort(404,"I don't care what they say, tomato is not a fruit")
  
      return "yummy"
  </code></pre>
  
  <p>Thank you in advance for your consideration and response.</p>