Open fredrikekre opened 4 years ago
Thanks that's an interesting point 🤔 ; the errors you're mentioning are most likely to happen when working on the layout which potentially affect all pages though so that pushed me to have Franklin fail early rather than have weird things happening, would you have suggestions for how to do this cleanly?
Maybe it could print the error but do nothing to the generated site until the errors are gone?
Yeah, I’ll have a think about it, the difficult part is to work out what to render in case of error; if you just render the top bit it might still look awful if, for instance, that block happens in a div and fails to close it properly;
Maybe what we could have is just a default “rendering failed due to X” page but the server doesn’t stop, and so as soon as it’s fixed the page gets loaded properly
What I had in mind was to keep the entire site in the state prior to the edit which caused the error; I'm not really aware of the way Franklin updates things, so maybe this could be a bit difficult?
But I also think that just having the server not to stop is good enough, for the only problem I see is the annoyance of going back to the terminal and restarting the server :upside_down_face:
Hmmmmm your first comment might be doable but trickier, also I think if the goal is to not go back to the terminal too often then the page should inform you of the error...
Ok here’s what I’ll try to do: add an error banner at the top of the page upon error; if there was previously html that was generated properly, use that with the banner, otherwise show a blank page.
It might take me some time to implement properly though 😬
I encountered this problem several times when I forgot to close an equation with $
sign. When I run serve
, I also expect it to be more forgiving. I don't mind it throwing an error to the terminal though. Here's my setup:
serve
I notice that
Franklin.serve
gives up and errors out quite often when you are in the middle of editing the source files. Here are some example errors:I believe this happens because of my habits to press Ctrl+S quite often. Would be nice if Frankling kept retrying instead of giving up.