mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-10-17 14:01:18 +00:00
Perform operation on network error (try/catch).
This commit is contained in:
1 parent
8ab9e6bac7
commit
e8da7baee2
1 file changed
+5
-3
@@ -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];
|
||||
|
||||
Reference in new issue
Block a user