Skip to content
This repository has been archived by the owner on Aug 5, 2020. It is now read-only.

Prevent colors from rendering on server errors #181

Merged
merged 3 commits into from
May 23, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/lib/server/errorHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ import * as secureHandlebars from "secure-handlebars";
import logger from "../logger";

const pretty = new PrettyError();
if (["1", "true"].includes(process.env.PRETTY_PRINT_WITHOUT_COLORS)) {
pretty.withoutColors();
}
else {
pretty.withColors();
}

/**
* Register handlebars helper that allows condition blocks for non production
Expand Down