Propagate JS exceptions into Perl