Skip to content

Try/catch on trying to read compiler log #1116

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

Merged
merged 3 commits into from
Aug 11, 2025
Merged

Conversation

zth
Copy link
Collaborator

@zth zth commented Aug 11, 2025

This sometimes blows up, if the compiler log does not exist for some reason. Simple try/catch to protect.

@zth zth requested a review from nojaf August 11, 2025 16:28
@zth
Copy link
Collaborator Author

zth commented Aug 11, 2025

A bunch of formatting changes. Removing.

let content = fs.readFileSync(compilerLogPath, { encoding: "utf-8" });
let content = "";
try {
content = fs.readFileSync(compilerLogPath, { encoding: "utf-8" });
Copy link
Member

Choose a reason for hiding this comment

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

Is an existence check worth it here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Potentially, but just trying to read it works the same I guess.

@zth zth merged commit accb287 into master Aug 11, 2025
6 checks passed
@zth zth deleted the try-catch-read-compiler-log branch August 11, 2025 18:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants