Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

print error in tests when reading project fails #12377

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
1 change: 1 addition & 0 deletions tests/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ export function findProjectOutputDir(projectdir: string | undefined) {
// deno-lint-ignore no-explicit-any
type = ((yaml as any).project as any).type;
} catch (error) {
console.error(error);
throw new Error("Failed to read quarto project YAML", error);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right this is not correct

It should be this, right ?

Suggested change
throw new Error("Failed to read quarto project YAML", error);
throw new Error("Failed to read quarto project YAML\n" + error);

This would show the error wouldn't it ? No need for a previous console.log ?
Or are you saying we need because playwright hide the error ?

Copy link
Contributor Author

@gordonwoodhull gordonwoodhull Mar 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking at this more carefully, it looks like what happens is the documents still render properly and tests succeed, but then it dies in a cleanup task, only printing the stack trace but not the error.

Because we're not in Playwright at this point (I think?) the error doesn't go into the Playwright logs.

It might be better to improve the error as you say, and then catch it somewhere further up the call stack and print it there.

}
if (type === "book") {
Expand Down
Loading