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

dont fatal in Watch.init, return error instead #21545

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mocompute
Copy link
Sponsor

Fixes #21543.

Since UnsupportedFlags was caught explicitly, I replaced the fatal() call with a std.log.err to maintain that behaviour. Returning an error from init() will help clients fail gracefully, especially zls: zigtools/zls#2041

Fixes ziglang#21543.

Since UnsupportedFlags was caught explicitly, I replaced the fatal()
call with a std.log.err to maintain that behaviour. Returning an error
from init() will help clients fail gracefully, especially zls:
zigtools/zls#2041
@mocompute
Copy link
Sponsor Author

In this repository, the only call to Watch.init(), which now returns an error instead of a fatal process exit, is from build_runner.zig's main function, so returning an error will have the same effect of exiting the process. But this change will allow zls to handle the failure gracefully,

var w = if (watch) try Watch.init() else undefined;

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.

Return error if Build.Watch is attempted on unsupported kernel
1 participant