Changeset 4194

Show
Ignore:
Timestamp:
06/03/06 16:05:31 (3 years ago)
Author:
morris
Message:

Do the same for some other error assignments

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • WiredAdditions/trunk/WIAddress.m

    r3787 r4194  
    5555         
    5656        if(!_address) { 
    57                 *error = [WIError errorWithDomain:WIWiredAdditionsErrorDomain 
    58                                                                          code:WIAddressLookupFailed 
    59                                                                  userInfo:[NSDictionary dictionaryWithObjectsAndKeys: 
    60                                                                          [WIError errorWithDomain:WILibWiredErrorDomain],       WILibWiredErrorKey, 
    61                                                                          address,                                                                                       WIArgumentErrorKey, 
    62                                                                          NULL]]; 
     57                if(error) { 
     58                        *error = [WIError errorWithDomain:WIWiredAdditionsErrorDomain 
     59                                                                                 code:WIAddressLookupFailed 
     60                                                                         userInfo:[NSDictionary dictionaryWithObjectsAndKeys: 
     61                                                                                 [WIError errorWithDomain:WILibWiredErrorDomain],       WILibWiredErrorKey, 
     62                                                                                 address,                                                                                       WIArgumentErrorKey, 
     63                                                                                 NULL]]; 
     64                } 
    6365                 
    6466                [self release]; 
     
    8284         
    8385        if([addresses count] == 0) { 
    84                 *error = [WIError errorWithDomain:WIWiredAdditionsErrorDomain 
    85                                                                          code:WIAddressNetServiceLookupFailed]; 
     86                if(error) { 
     87                        *error = [WIError errorWithDomain:WIWiredAdditionsErrorDomain 
     88                                                                                 code:WIAddressNetServiceLookupFailed]; 
     89                } 
    8690                 
    8791                [self release]; 
  • WiredAdditions/trunk/WISocket.m

    r4191 r4194  
    333333         
    334334        if(!wi_socket_connect(_socket, [context _context], timeout)) { 
    335                 *error = [WIError errorWithDomain:WIWiredAdditionsErrorDomain 
    336                                                                          code:WISocketConnectFailed 
    337                                                                  userInfo:[NSDictionary dictionaryWithObjectsAndKeys: 
    338                                                                          [WIError errorWithDomain:WILibWiredErrorDomain],       WILibWiredErrorKey, 
    339                                                                          [_address string],                                                                     WIArgumentErrorKey, 
    340                                                                          NULL]]; 
     335                if(error) { 
     336                        *error = [WIError errorWithDomain:WIWiredAdditionsErrorDomain 
     337                                                                                 code:WISocketConnectFailed 
     338                                                                         userInfo:[NSDictionary dictionaryWithObjectsAndKeys: 
     339                                                                                 [WIError errorWithDomain:WILibWiredErrorDomain],       WILibWiredErrorKey, 
     340                                                                                 [_address string],                                                                     WIArgumentErrorKey, 
     341                                                                                 NULL]]; 
     342                } 
    341343                 
    342344                result = NO; 
     
    436438        if([string length] == 0) { 
    437439                if(bytes < 0) { 
    438                         *error = [WIError errorWithDomain:WIWiredAdditionsErrorDomain 
    439                                                                                  code:WISocketReadFailed 
    440                                                                          userInfo:[NSDictionary dictionaryWithObjectsAndKeys: 
    441                                                                                  [WIError errorWithDomain:WILibWiredErrorDomain],       WILibWiredErrorKey, 
    442                                                                                  [_address string],                                                                     WIArgumentErrorKey, 
    443                                                                                  NULL]]; 
     440                        if(error) { 
     441                                *error = [WIError errorWithDomain:WIWiredAdditionsErrorDomain 
     442                                                                                         code:WISocketReadFailed 
     443                                                                                 userInfo:[NSDictionary dictionaryWithObjectsAndKeys: 
     444                                                                                         [WIError errorWithDomain:WILibWiredErrorDomain],       WILibWiredErrorKey, 
     445                                                                                         [_address string],                                                                     WIArgumentErrorKey, 
     446                                                                                         NULL]]; 
     447                        } 
    444448 
    445449                        [string release];