Skip to content

Commit

Permalink
fix(cli): log error message when encountering errors during docs prev…
Browse files Browse the repository at this point in the history
…iew server initiation. (#5164)

* Add `reloadDocsDefinition` error message log.

* Add changelog entry.
  • Loading branch information
eyw520 authored Nov 12, 2024
1 parent 9c555ad commit 4051652
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
7 changes: 7 additions & 0 deletions packages/cli/cli/versions.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
- changelogEntry:
- summary: |
Log error message logging when encountering doc errors during preview server initiation.
type: fix
irVersion: 53
version: 0.45.0-rc42

- changelogEntry:
- summary: Fixes bug introduced in 0.45.0-rc33 where version slugs were not being generated correctly.
type: fix
Expand Down
3 changes: 2 additions & 1 deletion packages/cli/docs-preview/src/runPreviewServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,9 @@ export async function runPreviewServer({
context.logger.error("Failed to read docs configuration. Rendering last successful configuration.");
}
if (err instanceof Error) {
context.logger.error(err.message);
if (err instanceof Error && err.stack) {
context.logger.debug(`${err.message}\n${err.stack}`);
context.logger.debug(`Stack Trace:\n${err.stack}`);
}
}
return docsDefinition;
Expand Down

0 comments on commit 4051652

Please sign in to comment.