Error handling

See https://rt.cpan.org/Ticket/Display.html?id=91199.