Skip to content

Commit

Permalink
fix showHtmlErrors
Browse files Browse the repository at this point in the history
Signed-off-by: George Lemon <[email protected]>
  • Loading branch information
georgelemon committed Mar 18, 2024
1 parent f413c86 commit 348a6bc
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/tim.nim
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ proc precompile*(engine: TimEngine, callback: TimCallback = nil,
template layoutWrapper(getViewBlock) {.dirty.} =
result = DOCKTYPE
var layoutTail: string
var displayError: bool
var hasError: bool
if not layout.jitEnabled:
# when requested layout is pre-rendered
# will use the static HTML version from disk
Expand All @@ -340,10 +340,10 @@ template layoutWrapper(getViewBlock) {.dirty.} =
getViewBlock
layoutTail = jitLayout.getTail()
else:
displayError = true
hasError = true
jitLayout.logger.displayErrors()
when not defined release:
if displayError:
if engine.showHtmlErrors and hasError:
add result, htmlerror
htmlerror = ""
add result, layoutTail
Expand Down

0 comments on commit 348a6bc

Please sign in to comment.