Fixed in https://github.com/rakudo/rakudo/commit/3b5ef07cee
Tests added in 
https://github.com/perl6/roast/blob/412539ab809a769b7bf36df02c4aba8040f95f7e/S04-exceptions/exceptions-json.t#L27


On Wed Oct 05 11:07:23 2016, nxadm wrote:
> Hi,
> 
> Great job adding JSON error output (lizmat++). This will make tooling a 
> lot better!
> 
> So far it seems to work well, but I found a use case where no JSON is 
> thrown, but the regular error text. Specifically, the error output is 
> skipped when a module is loaded that does not exit.
> 
> I created some 'error state' modules to test the perl6 syntax support: 
> https://github.com/nxadm/syntastic-perl6/tree/JSON_2016.09/t (the code 
> hasn't yet been ported to support JSON).
> 
> Here is the output of for the module_not_found.pm6 where the JSON output 
> is not thrown:
> 
> 
> ~/Code/syntastic-perl6/t$ /opt/rakudo/bin/perl6 -v
> This is Rakudo version 2016.09 built on MoarVM version 2016.09
> implementing Perl 6.c.
> 
> ~/Code/syntastic-perl6/t$ cat module_not_found.pm6
> unit package ModuleNotFoundTest;
> use abcdefghijklmnopqrstuvwxyz1234567891011121314151617181920;
> 
> ~/Code/syntastic-perl6/t$ RAKUDO_EXCEPTIONS_HANDLER=JSON 
> /opt/rakudo/bin/perl6 -c module_not_found.pm6
> Unhandled exception: Can't serialize an object of type 
> CompUnit::DependencySpecification
>     at <unknown>:1 
> (/opt/rakudo/share/perl6/runtime/CORE.setting.moarvm:throw)
>   from gen/moar/m-CORE.setting:819 
> (/opt/rakudo/share/perl6/runtime/CORE.setting.moarvm:die)
>   from gen/moar/m-CORE.setting:807 
> (/opt/rakudo/share/perl6/runtime/CORE.setting.moarvm:die)
>   from gen/moar/m-CORE.setting:39400 
> (/opt/rakudo/share/perl6/runtime/CORE.setting.moarvm:to-json)
>   from gen/moar/m-CORE.setting:39376 
> (/opt/rakudo/share/perl6/runtime/CORE.setting.moarvm:to-json)
>   from gen/moar/m-CORE.setting:39395 
> (/opt/rakudo/share/perl6/runtime/CORE.setting.moarvm:)
>   from gen/moar/m-CORE.setting:4908 
> (/opt/rakudo/share/perl6/runtime/CORE.setting.moarvm:push-all)
>   from gen/moar/m-CORE.setting:2697 
> (/opt/rakudo/share/perl6/runtime/CORE.setting.moarvm:push-until-lazy)
>   from gen/moar/m-CORE.setting:16196 
> (/opt/rakudo/share/perl6/runtime/CORE.setting.moarvm:reify-until-lazy)
>   from gen/moar/m-CORE.setting:17249 
> (/opt/rakudo/share/perl6/runtime/CORE.setting.moarvm:join)
>   from gen/moar/m-CORE.setting:2066 
> (/opt/rakudo/share/perl6/runtime/CORE.setting.moarvm:join)
>   from gen/moar/m-CORE.setting:39395 
> (/opt/rakudo/share/perl6/runtime/CORE.setting.moarvm:to-json)
>   from gen/moar/m-CORE.setting:39376 
> (/opt/rakudo/share/perl6/runtime/CORE.setting.moarvm:to-json)
>   from gen/moar/m-CORE.setting:39395 
> (/opt/rakudo/share/perl6/runtime/CORE.setting.moarvm:)
>   from gen/moar/m-CORE.setting:4908 
> (/opt/rakudo/share/perl6/runtime/CORE.setting.moarvm:push-all)
>   from gen/moar/m-CORE.setting:2697 
> (/opt/rakudo/share/perl6/runtime/CORE.setting.moarvm:push-until-lazy)
>   from gen/moar/m-CORE.setting:16196 
> (/opt/rakudo/share/perl6/runtime/CORE.setting.moarvm:reify-until-lazy)
>   from gen/moar/m-CORE.setting:17249 
> (/opt/rakudo/share/perl6/runtime/CORE.setting.moarvm:join)
>   from gen/moar/m-CORE.setting:2066 
> (/opt/rakudo/share/perl6/runtime/CORE.setting.moarvm:join)
>   from gen/moar/m-CORE.setting:39395 
> (/opt/rakudo/share/perl6/runtime/CORE.setting.moarvm:to-json)
>   from gen/moar/m-CORE.setting:39376 
> (/opt/rakudo/share/perl6/runtime/CORE.setting.moarvm:to-json)
>   from gen/moar/m-CORE.setting:39410 
> (/opt/rakudo/share/perl6/runtime/CORE.setting.moarvm:to-json)
>   from gen/moar/m-CORE.setting:26815 
> (/opt/rakudo/share/perl6/runtime/CORE.setting.moarvm:process)
>   from gen/moar/m-CORE.setting:24542 
> (/opt/rakudo/share/perl6/runtime/CORE.setting.moarvm:)
>   from gen/moar/m-CORE.setting:24540 
> (/opt/rakudo/share/perl6/runtime/CORE.setting.moarvm:)
>   from gen/moar/m-CORE.setting:24538 
> (/opt/rakudo/share/perl6/runtime/CORE.setting.moarvm:print_exception)
>   from gen/moar/m-CORE.setting:24630 
> (/opt/rakudo/share/perl6/runtime/CORE.setting.moarvm:<anon>)
>   from gen/moar/stage2/NQPHLL.nqp:1559 
> (/opt/rakudo/share/nqp/lib/NQPHLL.moarvm:command_eval)
>   from src/Perl6/Compiler.nqp:27 
> (/opt/rakudo/share/nqp/lib/Perl6/Compiler.moarvm:command_eval)
>   from gen/moar/stage2/NQPHLL.nqp:1499 
> (/opt/rakudo/share/nqp/lib/NQPHLL.moarvm:command_line)
>   from gen/moar/m-main.nqp:47 
> (/opt/rakudo/share/perl6/runtime/perl6.moarvm:MAIN)
>   from gen/moar/m-main.nqp:38 
> (/opt/rakudo/share/perl6/runtime/perl6.moarvm:<mainline>)
>   from <unknown>:1  (/opt/rakudo/share/perl6/runtime/perl6.moarvm:<main>)
>   from <unknown>:1  (/opt/rakudo/share/perl6/runtime/perl6.moarvm:<entry>)



Reply via email to