Hakyll cuts off exception tracebacks

Skip to first unread message

Gwern Branwen

Aug 7, 2021, 8:21:13 PM8/7/21
to hakyll
In adding regexps to LinkAuto, I sometimes fail to close a parenthesis
or something, and this triggers a compilation exception when the
string can't be `makeRegex`ed into a valid Regex. In ghci or when
compiled to a standalone binary, regex-tdfa helpfully prints out the
offending string, which is good because I'm at >1000 regexps now, and
bisecting by hand is not fun. But when I compile a Hakyll binary and
run it, only one line is printed, the module/library it crashed in,
and the actual exception appears to be suppressed or otherwise
mangled, removing the necessary information:

> R.matchTest (R.makeRegex "(foo|" :: R.Regex) "foo"
*** Exception: Explict error in module Text.Regex.TDFA.String :
Text.Regex.TDFA.String died: parseRegex for Text.Regex.TDFA.String
failed:"(foo|" (line 1, column 6):
unexpected end of input
expecting empty () or anchor ^ or $ or an atom
CallStack (from HasCallStack):
error, called at lib/Text/Regex/TDFA/Common.hs:29:3 in

$ ./static/build/hakyll build
Creating store...
Creating provider...
Running rules...
"Local archives parsing..."
"Popups parsing..."
"Writing annotations..."
hakyll: makeRegexOpts failed
CallStack (from HasCallStack):
error, called at src/Text/Regex/Base/RegexLike.hs:136:32 in

I can't find anywhere in the Hakyll source where it is doing callstack
stuff or throwing away exception information. Anyone have an idea
where things might be going wrong? In general, Hakyll should print out
all of an exception, not merely part of it.

Reply all
Reply to author
0 new messages