Skip to content

Commit

Permalink
Add banner for code highlighting exceptions, improves #2095
Browse files Browse the repository at this point in the history
  • Loading branch information
josevalim committed Mar 6, 2025
1 parent a2a9869 commit 42832e2
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/ex_doc/doc_ast.ex
Original file line number Diff line number Diff line change
Expand Up @@ -180,11 +180,13 @@ defmodule ExDoc.DocAST do
try do
render_code(pre_attr, lang, lexer, opts, code, outer_opts)
rescue
_ ->
exception ->
ExDoc.Utils.warn(
[
"crashed while highlighting #{lang} snippet:\n\n",
full_block
full_block,
"\n\n",
Exception.format_banner(:error, exception, __STACKTRACE__)
],
__STACKTRACE__
)
Expand Down

0 comments on commit 42832e2

Please sign in to comment.