Hakyll cuts off exception tracebacks

14 views
Skip to first unread message

Gwern Branwen

unread,
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
regex-tdfa-1.3.1.0-DBF8dtczDg8JlmvN5Houeh:Text.Regex.TDFA.Common

$ ./static/build/hakyll build
Initialising...
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
regex-base-0.94.0.1-hLhthJroryD8TkUvDLEVt:Text.Regex.Base.RegexLike

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.

--
gwern
https://www.gwern.net
Reply all
Reply to author
Forward
0 new messages