Skip to content
This repository has been archived by the owner on Jun 23, 2021. It is now read-only.

Printing errors to console properly #190

Merged
merged 5 commits into from
Nov 22, 2018
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion packages/sanity/src/hydration-test/server.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export async function hydrationTest(
} catch (error) {
process.exitCode = 1;
if (error) {
process.stderr.write(error.toString());
process.stderr.write(error.toString() + '\n');
}
} finally {
if (server) {
Expand Down
3 changes: 2 additions & 1 deletion packages/scripts/src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ program
} catch (error) {
process.exitCode = 1;
if (error) {
process.stderr.write(error.toString());
// Without a new-line, the error will not show on certain node versions
process.stderr.write(error.toString() + '\n');
}
}
});
Expand Down
2 changes: 1 addition & 1 deletion packages/showcase/src/server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ export async function buildWebsite(
throw websiteStats.toString();
}
} catch (e) {
process.stderr.write(e);
process.stderr.write(e + '\n');
process.exit(1);
}
}
2 changes: 1 addition & 1 deletion packages/utils/src/serve/log.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export class Log {

public compilationError(error: Error) {
process.stderr.write(chalk.red('Compilation failed.\n'));
process.stderr.write(error.toString());
process.stderr.write(error.toString() + '\n');
}

public serverListening = (url: string) => {
Expand Down