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

Differentiate errors and warnings in strict mode. #262

Open
burtek opened this issue Nov 28, 2024 · 0 comments
Open

Differentiate errors and warnings in strict mode. #262

burtek opened this issue Nov 28, 2024 · 0 comments

Comments

@burtek
Copy link

burtek commented Nov 28, 2024

    const { build } = await import('velite');
    await build({ strict: ... });

With strict: true, both warnings and errors in the schema terminate the build and make build throw.

With strict: false, both warnings and errors are logged, but build process is not terminated, and build finishes gracefully, without any suggestion in the return value that something went wrong.

There should be a way to tell velite to throw on errors but continue on warnings.

Use case: Make velite throw if a blog post is missing a title, but just give a warning if the same post has a value enabled even though the prerequisites are not met (i.e. tocEnabled is true but s.toc() created empty table of content).

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

No branches or pull requests

1 participant