Skip to content

Commit 42832e2

Browse files
committed
Add banner for code highlighting exceptions, improves #2095
1 parent a2a9869 commit 42832e2

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/ex_doc/doc_ast.ex

+4-2
Original file line numberDiff line numberDiff line change
@@ -180,11 +180,13 @@ defmodule ExDoc.DocAST do
180180
try do
181181
render_code(pre_attr, lang, lexer, opts, code, outer_opts)
182182
rescue
183-
_ ->
183+
exception ->
184184
ExDoc.Utils.warn(
185185
[
186186
"crashed while highlighting #{lang} snippet:\n\n",
187-
full_block
187+
full_block,
188+
"\n\n",
189+
Exception.format_banner(:error, exception, __STACKTRACE__)
188190
],
189191
__STACKTRACE__
190192
)

0 commit comments

Comments
 (0)