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

Unknown languages crash render #225

Closed
isaacwhite opened this issue Sep 30, 2020 · 0 comments · Fixed by #226
Closed

Unknown languages crash render #225

isaacwhite opened this issue Sep 30, 2020 · 0 comments · Fixed by #226
Labels
bug Something isn't working

Comments

@isaacwhite
Copy link
Member

Context (Environment)

Observed this in the logs on our own copy of Library, which should not be causing a 500.

'Unknown language: "archieml"'

This is probably coming from the new syntax highlighting code added in the most recent release.

Expected Behavior

When the language is unknown, we should render without syntax highlighting.

Actual Behavior

The app returns a 500 until the unknown language is removed

To Reproduce

Try creating a code snippet where the language is archieml

Possible Solution

Use a try/catch in this section of the formatter code, so that errors thrown by hljs are nonfatal: https://github.com/nytimes/library/blob/master/server/formatter.js#L112-L116

@isaacwhite isaacwhite added the bug Something isn't working label Sep 30, 2020
@afischer afischer linked a pull request Oct 1, 2020 that will close this issue
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant