Revision: 27916
          http://sourceforge.net/p/bibdesk/svn/27916
Author:   hofman
Date:     2022-09-20 17:25:09 +0000 (Tue, 20 Sep 2022)
Log Message:
-----------
only check for authentication failure or cancel for legacy servers requireing 
authentication, otherwise it will be a real exception

Modified Paths:
--------------
    trunk/bibdesk/BDSKSharingClient.m

Modified: trunk/bibdesk/BDSKSharingClient.m
===================================================================
--- trunk/bibdesk/BDSKSharingClient.m   2022-09-20 17:05:49 UTC (rev 27915)
+++ trunk/bibdesk/BDSKSharingClient.m   2022-09-20 17:25:09 UTC (rev 27916)
@@ -402,19 +402,23 @@
             [conn invalidate];
             conn = nil;
             proxy = nil;
-
-            if (atomic_load(&canceledAuthentication) && ([[exception name] 
isEqual:NSGenericException] || [[exception name] 
isEqual:NSFailedAuthenticationException])) {
-                // NSGenericException is thrown when authentication is canceled
-                // don't throw when canceled
-            } else if([[exception name] 
isEqual:NSFailedAuthenticationException]){
-                // flag authentication failures so we get a prompt the next 
time around (in case our password was wrong)
-                atomic_store(&authenticationFailed, YES);
-                // don't show the alert when we couldn't authenticate when 
cleaning up
-                if([self shouldKeepRunning])
-                    [self runAuthenticationFailedAlert];
-                // unfortunately for newer OS version this exception is not 
thrown
-                // should we also interpret NSPortTimeoutException as 
authentication failure?
-            } else{
+            
+            if (needsAuthentication && legacyServer) {
+                if (atomic_load(&canceledAuthentication) && [[exception name] 
isEqual:NSGenericException]) {
+                    // NSGenericException is thrown when authentication is 
canceled
+                    // don't throw when canceled
+                } else if([[exception name] 
isEqual:NSFailedAuthenticationException]){
+                    // flag authentication failures so we get a prompt the 
next time around (in case our password was wrong)
+                    atomic_store(&authenticationFailed, YES);
+                    // don't show the alert when we couldn't authenticate when 
cleaning up
+                    if([self shouldKeepRunning])
+                        [self runAuthenticationFailedAlert];
+                    // unfortunately for newer OS version this exception is 
not thrown
+                    // should we also interpret NSPortTimeoutException as 
authentication failure?
+                } else{
+                    @throw [NSString stringWithFormat:@"%@: exception \"%@\" 
while connecting to remote server %@", NSStringFromSelector(_cmd), exception, 
[service hostName]];
+                }
+            } else {
                 @throw [NSString stringWithFormat:@"%@: exception \"%@\" while 
connecting to remote server %@", NSStringFromSelector(_cmd), exception, 
[service hostName]];
             }
         }

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.



_______________________________________________
Bibdesk-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bibdesk-commit

Reply via email to