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

Generators should be able to surface errors #44

Closed
jbeeko opened this issue Feb 22, 2020 · 1 comment
Closed

Generators should be able to surface errors #44

jbeeko opened this issue Feb 22, 2020 · 1 comment

Comments

@jbeeko
Copy link
Contributor

jbeeko commented Feb 22, 2020

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:

An unexpected error happend: Exception has been thrown by the target of an invocation.
... more useless logging which tells you nothing

My first thought was to catch the invocation exception and indicate which page is failing during the generation phase.

That results in this:

The expression for /Users/joergbeekmann/Documents/Fornax/FornaxDemo/generators/post.fsx either couldn't be compiled or experianced a runtime
[11:34:23] '/Users/joergbeekmann/Documents/Fornax/FornaxDemo/_public/posts/post2.html' generation failed

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.

I propose the load/generate phases be changed to collect editing level errors and surface them in the console. See PR #46 for a proof of concept.

@jbeeko
Copy link
Contributor Author

jbeeko commented Feb 24, 2020

Closed see comments in PR

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