Perform operation on network error (try/catch).

This commit is contained in:
cacaodev
2015-10-01 13:19:40 +02:00
parent 8ab9e6bac7
commit e8da7baee2
+5 -3
View File
@@ -274,6 +274,8 @@ var CPURLConnectionDelegate = nil;
{
if ([_delegate respondsToSelector:@selector(connection:didFailWithError:)])
[_delegate connection:self didFailWithError:anException];
else if (_connectionOperation !== nil)
[self _connectionOperationDidReceiveResponse:nil data:nil error:anException];
}
/*
@@ -340,10 +342,10 @@ var CPURLConnectionDelegate = nil;
if (!_isCanceled)
{
if (_connectionOperation !== nil)
[self _connectionOperationDidReceiveResponse:response data:_HTTPRequest.responseText() error:nil];
else if ([_delegate respondsToSelector:@selector(connection:didReceiveData:)])
if ([_delegate respondsToSelector:@selector(connection:didReceiveData:)])
[_delegate connection:self didReceiveData:_HTTPRequest.responseText()];
else if (_connectionOperation !== nil)
[self _connectionOperationDidReceiveResponse:response data:_HTTPRequest.responseText() error:nil];
if ([_delegate respondsToSelector:@selector(connectionDidFinishLoading:)])
[_delegate connectionDidFinishLoading:self];