collect and propogate loader errors #46
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Currently if a generator operates over invalid page data it is not able to express this in a nice way. For example if a post.md file is missing title in the top matter this is the result:
To see this happen simply add a new file to the /posts director while in watch mode. The result is an immediate exception and termination of watch mode.
My first thought was to catch the invocation exception and indicate which page is failing during the load/generation phase.
That results in this:
Better, at least you know which page it is. But there is no way for the generator to indicate what is wrong with the markdown on the page. In this case a missing title.
This PR explores how to collect errors that occur during the load phase and then surface them as notifications in the console. That results in the following:
This PR is a proof of concept to go with issue #44.