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

Allow to ignore 404 errors #168

Open
ogizanagi opened this issue Feb 22, 2023 · 0 comments
Open

Allow to ignore 404 errors #168

ogizanagi opened this issue Feb 22, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@ogizanagi
Copy link
Member

ogizanagi commented Feb 22, 2023

The build command currently allows to ignore specific content not found errors when the content is handled by Stenope (when a ContentNotFoundException is thrown (using the --ignore-content-not-found), e.g: when using the controller argument resolver.

But in some cases, it can be useful to ignore as well 404 HTTP errors triggered by the framework.

In most cases, such errors are problematic and should be highlighted or interrupt the build, because it means a 404 page is referenced somewhere.
But there can also be some case where a GET route with no param is simply collected and generates a 404 in the context of a specific build, while not being referenced in any page (for instance if the link is rendered conditionally, avoiding to render it if the targeted resource is not available).

I had such a use-case where my static build includes a catalog.pdf GET route to expose & dump a PDF in the static build.
But if the PDF file is not available, the link is not rendered in any page. Still, the GET route has no parameter, so it's collected during the scanning phase of the build command.

@ogizanagi ogizanagi added the enhancement New feature or request label Feb 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant