# coding: utf-8
"""An error handler for JupyterLab."""
# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
from tornado import web
from jupyterlab_server.server import JupyterHandler
TEMPLATE = """
JupyterLab Error
JupyterLab Error
%s
"""
class ErrorHandler(JupyterHandler):
def initialize(self, messages):
self.messages = messages
@web.authenticated
@web.removeslash
def get(self):
msgs = ['%s
' % msg for msg in self.messages]
self.write(TEMPLATE % '\n'.join(msgs))