Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide a fallback for templates #301

Closed
blink1073 opened this issue Sep 3, 2020 · 1 comment
Closed

Provide a fallback for templates #301

blink1073 opened this issue Sep 3, 2020 · 1 comment

Comments

@blink1073
Copy link
Contributor

If a template exists in jupyter_server, we should fall back to it. e.g. error.html here:

    Traceback (most recent call last):
      File "/Users/stslve/miniconda/envs/jlab-master/lib/python3.7/site-packages/tornado/web.py", line 1218, in send_error
        self.write_error(status_code, **kwargs)
      File "/Users/stslve/miniconda/envs/jlab-master/lib/python3.7/site-packages/jupyter_server/base/handlers.py", line 511, in write_error
        html = self.render_template('error.html', **ns)
      File "/Users/stslve/miniconda/envs/jlab-master/lib/python3.7/site-packages/jupyter_server/base/handlers.py", line 440, in render_template
        template = self.get_template(name)
      File "/Users/stslve/miniconda/envs/jlab-master/lib/python3.7/site-packages/jupyter_server/extension/handler.py", line 12, in get_template
        return self.settings[env].get_template(name)
      File "/Users/stslve/miniconda/envs/jlab-master/lib/python3.7/site-packages/jinja2/environment.py", line 883, in get_template
        return self._load_template(name, self.make_globals(globals))
      File "/Users/stslve/miniconda/envs/jlab-master/lib/python3.7/site-packages/jinja2/environment.py", line 857, in _load_template
        template = self.loader.load(self, name, globals)
      File "/Users/stslve/miniconda/envs/jlab-master/lib/python3.7/site-packages/jinja2/loaders.py", line 115, in load
        source, filename, uptodate = self.get_source(environment, name)
      File "/Users/stslve/miniconda/envs/jlab-master/lib/python3.7/site-packages/jinja2/loaders.py", line 197, in get_source
        raise TemplateNotFound(template)
    jinja2.exceptions.TemplateNotFound: error.html
@Zsailer
Copy link
Member

Zsailer commented Sep 4, 2020

Fixed in #302

@Zsailer Zsailer closed this as completed Sep 4, 2020
Zsailer added a commit to Zsailer/jupyter_server that referenced this issue Nov 18, 2022
…server#301)

* add synchronizer and persistent storage

* missing import from squash

* relax unit test threshold

* use process_id everywhere

* formatting mistake
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants