"""`main` is the top level module for your Flask application."""

# Import the Flask Framework
from flask import Flask
app = Flask(__name__)
# Note: We don't need to call run() since our application is embedded within
# the App Engine WSGI application server.


@app.route('/')
def hello():
    """Return a friendly HTTP greeting."""
    return 'Hello World!'


@app.errorhandler(404)
def page_not_found(e):
    """Return a custom 404 error."""
    return 'Sorry, Nothing at this URL.', 404

"""`main` is the top level module for your Flask application."""

# Import the Flask Framework
from flask import Flask
app = Flask(__name__)
# Note: We don't need to call run() since our application is embedded within
# the App Engine WSGI application server.


@app.route('/')
def hello():
    """Return a friendly HTTP greeting."""
    return 'Hello World!'


@app.errorhandler(404)
def page_not_found(e):
    """Return a custom 404 error."""
    return 'Sorry, Nothing at this URL.', 404


@app.errorhandler(500)
def page_not_found(e):
    """Return a custom 500 error."""
    return 'Sorry, unexpected error: {}'.format(e), 500

Add custom 500 error handler so app handler errors aren't supressed
Add custom 500 error handler so app handler errors aren't supressed

  """`main` is the top level module for your Flask application."""
  
  # Import the Flask Framework
  from flask import Flask
  app = Flask(__name__)
  # Note: We don't need to call run() since our application is embedded within
  # the App Engine WSGI application server.
  
  
  @app.route('/')
  def hello():
      """Return a friendly HTTP greeting."""
      return 'Hello World!'
  
  
  @app.errorhandler(404)
  def page_not_found(e):
      """Return a custom 404 error."""
      return 'Sorry, Nothing at this URL.', 404
  
+ 
+ @app.errorhandler(500)
+ def page_not_found(e):
+     """Return a custom 500 error."""
+     return 'Sorry, unexpected error: {}'.format(e), 500
+ 
Add custom 500 error handler so app handler errors aren't supressed
## Code Before:
"""`main` is the top level module for your Flask application."""

# Import the Flask Framework
from flask import Flask
app = Flask(__name__)
# Note: We don't need to call run() since our application is embedded within
# the App Engine WSGI application server.


@app.route('/')
def hello():
    """Return a friendly HTTP greeting."""
    return 'Hello World!'


@app.errorhandler(404)
def page_not_found(e):
    """Return a custom 404 error."""
    return 'Sorry, Nothing at this URL.', 404

## Instruction:
Add custom 500 error handler so app handler errors aren't supressed
## Code After:
"""`main` is the top level module for your Flask application."""

# Import the Flask Framework
from flask import Flask
app = Flask(__name__)
# Note: We don't need to call run() since our application is embedded within
# the App Engine WSGI application server.


@app.route('/')
def hello():
    """Return a friendly HTTP greeting."""
    return 'Hello World!'


@app.errorhandler(404)
def page_not_found(e):
    """Return a custom 404 error."""
    return 'Sorry, Nothing at this URL.', 404


@app.errorhandler(500)
def page_not_found(e):
    """Return a custom 500 error."""
    return 'Sorry, unexpected error: {}'.format(e), 500
