title: Handle an error from flask decorator
body: <p>I have one questions, which related to decorators. for example I wrote the next decorator, which handle the error, and then just output the error.</p>
  
  <pre><code>def handle_error(func):
      def wrapper(*args, **kwargs):
          try:
              return func(*args, **kwargs)
          except Exception as err:
              print(err)
      return wrapper
  
  
  @handle_error
  def raise_error():
      return 1 / 0
  
  raise_error()
  </code></pre>
  
  <p>But, if I want to do the same with <strong>Flask</strong> it's doesn't work.</p>
  
  <pre><code>@app.route('/')
  @handle_error
  def index():
      return {'hello'}
  
  if __name__ == '__main__':
      app.run()
  </code></pre>
  
  <p>So I'm guessing, the error raised in <strong>route</strong> decorator, am I right? if yes, I have question: Technically I can to write an decorator which will be handle all exceptions from <strong>route</strong> decorator?</p>