'Test raising an generic exception in a threaded handler.'

def testUnknownException(self):

    raised_errors = []
    def message(msg):
        raise ValueError('Did    something    wrong')
    def catch_error(*args, **kwargs):
        raised_errors.append(True)
    self.stream_start()
    self.xmpp.exception = catch_error
    self.xmpp.add_event_handler('message', message)
    self.recv('\n                                        <message>\n                                                <body>This    is    going    to    cause    an    error.</body>\n                                        </message>\n                                ')
    self.send('\n                                        <message    type="error">\n                                                <error    type="cancel"    code="500">\n                                                        <undefined-condition\n                                                                        xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"    />\n                                                        <text    xmlns="urn:ietf:params:xml:ns:xmpp-stanzas">\n                                                                SleekXMPP    got    into    trouble.\n                                                        </text>\n                                                </error>\n                                        </message>\n                                ')
    self.assertEqual(raised_errors, [True], ('Exception    was    not    raised:    %s' % raised_errors))
