Better error messages?
#207
Closed
opened 5 years ago by sorawee
·
5 comments
Loading…
Reference in New Issue
There is no content yet.
Delete Branch '%!s(<nil>)'
Deleting a branch is permanent. It CANNOT be undone. Continue?
(This is potentially a WONTFIX)
Issue 1: missing template
If I have the following setup:
but doesn't have
template.tex.p
(or any other kind of templates), when runningraco pollen render foo.tex
(wherefoo.poly.pm
is the source file), there will be the following error:While the error does mention "valid template path for target tex", it's still a pretty obscure error message and looks like internal errors. Can this be improved in any way?
Issue 2: missing files
If I
raco pollen render asdqwe
whereasdqwe
doesn't exist at all (both as an input file and output file), Pollen still seems to be happy and just output:I expect an error to occur along with a descriptive error message.
What would be a better way of presenting the error?
I think in this case
raise-user-error
would be more appropriate than contract errors. To quote https://docs.racket-lang.org/reference/exns.html#%28def.%28%28quote.~23~25kernel%29._raise-user-error%29%29:OK, changed those error types.
After trying it out, I don’t like the ergonomics of raising an error for a missing file. So I’ve reverted it (to just being a no-op).
In my case, I tried rendering a certain pagetree where a couple underlying source files had been deleted. Before, the render would proceed normally. But this time, I had to go through the pagetree and delete every missing file before I could render. It just felt like pointless homework.
However, if you do
raco pollen render asdqwe
you will now be told:Thanks!