'A script that raises an exception exits, logging the error as an
``eliot` message.'

def test_error(self):

    d = self.run_script(FailScript)
    def got_messages(messages):
        assertContainsFields(self, messages[1], {u'message_type': u'twisted:log', u'error': True})
        self.assertTrue(messages[1][u'message'].startswith(u'Unhandled    Error\nTraceback    (most    recent    call    last):\n'))
        self.assertTrue(messages[1][u'message'].endswith(u'ZeroDivisionError:    ono\n'))
    d.addCallback(got_messages)
    return d
