Changeset 4285

Show
Ignore:
Timestamp:
06/10/06 01:38:33 (2 years ago)
Author:
morris
Message:

Add -ignoreError to temporarily silence errors we know may come

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • WiredClient/trunk/WCConnection.h

    r3963 r4285  
    127127- (void)sendCommand:(NSString *)command withArgument:(NSString *)argument1 withArgument:(NSString *)argument2 withArgument:(NSString *)argument3; 
    128128- (void)sendCommand:(NSString *)command withArguments:(NSArray *)arguments; 
     129- (void)ignoreError:(unsigned int)error; 
    129130 
    130131- (void)connect; 
  • WiredClient/trunk/WCServerConnection.h

    r4148 r4285  
    5858        WCServerInfo                                                                    *_serverInfo; 
    5959        WCTransfers                                                                             *_transfers; 
     60         
     61        unsigned int                                                                    _ignoreErrorMessage; 
     62        NSTimeInterval                                                                  _ignoreErrorTime; 
    6063         
    6164        BOOL                                                                                    _sentLogin; 
  • WiredClient/trunk/WCServerConnection.m

    r4184 r4285  
    631631 
    632632 
     633- (void)ignoreError:(unsigned int)error { 
     634        _ignoreErrorMessage     = error; 
     635        _ignoreErrorTime        = [NSDate timeIntervalSinceReferenceDate]; 
     636} 
     637 
     638 
     639 
    633640#pragma mark - 
    634641 
     
    825832                default: 
    826833                        if(message >= 500 && message <= 599) { 
    827                                 name = WCConnectionReceivedError; 
    828                                 error = [WCError errorWithDomain:WCWiredErrorDomain 
    829                                                                                         code:message 
    830                                                                                 userInfo:[NSDictionary dictionaryWithObjectsAndKeys: 
    831                                                                                         [arguments safeObjectAtIndex:0],        WIArgumentErrorKey, 
    832                                                                                         NULL]]; 
    833                                  
    834                                 [userInfo setObject:error forKey:WCErrorKey]; 
     834                                if(_ignoreErrorMessage != message || _ignoreErrorTime < [NSDate timeIntervalSinceReferenceDate] - 5.0) { 
     835                                        name = WCConnectionReceivedError; 
     836                                        error = [WCError errorWithDomain:WCWiredErrorDomain 
     837                                                                                                code:message 
     838                                                                                        userInfo:[NSDictionary dictionaryWithObjectsAndKeys: 
     839                                                                                                [arguments safeObjectAtIndex:0],        WIArgumentErrorKey, 
     840                                                                                                NULL]]; 
     841                                         
     842                                        [userInfo setObject:error forKey:WCErrorKey]; 
     843                                } 
     844                                         
     845                                _ignoreErrorMessage = 0; 
    835846                        } 
    836847                        break; 
  • WiredClient/trunk/WCTrackerConnection.h

    r3503 r4285  
    3737        NSNotificationCenter                                            *_notificationCenter; 
    3838         
     39        unsigned int                                                                    _ignoreErrorMessage; 
     40        NSTimeInterval                                                                  _ignoreErrorTime; 
     41         
    3942        BOOL                                                                            _terminate; 
    4043} 
  • WiredClient/trunk/WCTrackerConnection.m

    r4183 r4285  
    232232 
    233233 
     234- (void)ignoreError:(unsigned int)error { 
     235        _ignoreErrorMessage     = error; 
     236        _ignoreErrorTime        = [NSDate timeIntervalSinceReferenceDate]; 
     237} 
     238 
     239 
     240 
    234241#pragma mark - 
    235242 
     
    294301                default: 
    295302                        if(message >= 500 && message <= 599) { 
    296                                 name = WCConnectionReceivedError; 
    297                                 error = [WCError errorWithDomain:WCWiredErrorDomain 
    298                                                                                         code:message 
    299                                                                                 userInfo:[NSDictionary dictionaryWithObjectsAndKeys: 
    300                                                                                         [arguments safeObjectAtIndex:0],        WIArgumentErrorKey, 
    301                                                                                         NULL]]; 
     303                                if(_ignoreErrorMessage != message || _ignoreErrorTime < [NSDate timeIntervalSinceReferenceDate] - 5.0) { 
     304                                        name = WCConnectionReceivedError; 
     305                                        error = [WCError errorWithDomain:WCWiredErrorDomain 
     306                                                                                                code:message 
     307                                                                                        userInfo:[NSDictionary dictionaryWithObjectsAndKeys: 
     308                                                                                                [arguments safeObjectAtIndex:0],        WIArgumentErrorKey, 
     309                                                                                                NULL]]; 
     310                                         
     311                                        [userInfo setObject:error forKey:WCErrorKey]; 
     312                                } 
    302313                                 
    303                                 [userInfo setObject:error forKey:WCErrorKey]
     314                                _ignoreErrorMessage = 0
    304315                        } 
    305316                        break; 
  • WiredClient/trunk/WCTransfers.m

    r4284 r4285  
    644644         
    645645        if([[NSFileManager defaultManager] directoryExistsAtPath:path]) { 
     646                [[self connection] ignoreError:521]; 
    646647                [[self connection] sendCommand:WCFolderCommand withArgument:remotePath]; 
    647648