Make it possible to get exceptions in async mode.

This commit is contained in:
Jonathan Schleifer 2012-11-24 01:36:29 +01:00
parent 334586bb07
commit 6a89ab76d0
2 changed files with 27 additions and 2 deletions

View file

@ -344,13 +344,26 @@
exception: (OFException*)exception
{
if (exception != nil) {
[delegates broadcastSelector: @selector(connection:
didThrowException::)
withObject: self
withObject: exception];
[self close];
return NO;
}
if (![self XMPP_parseBuffer: buffer
length: length])
@try {
if (![self XMPP_parseBuffer: buffer
length: length])
return NO;
} @catch (id e) {
[delegates broadcastSelector: @selector(connection:
didThrowException::)
withObject: self
withObject: e];
[self close];
return NO;
}
if (oldParser != nil || oldElementBuilder != nil) {
[oldParser release];