Changeset 7004 in josm for trunk/src/org/openstreetmap/josm/gui/oauth/OsmOAuthAuthorizationClient.java
- Timestamp:
- 2014-04-26T15:28:16+02:00 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/oauth/OsmOAuthAuthorizationClient.java
r6995 r7004 26 26 import oauth.signpost.OAuthProvider; 27 27 import oauth.signpost.basic.DefaultOAuthProvider; 28 import oauth.signpost.exception.OAuthCommunicationException;29 28 import oauth.signpost.exception.OAuthException; 30 29 … … 110 109 con.disconnect(); 111 110 } 112 } catch (NoSuchFieldException e) { 113 Main.error(e); 114 Main.warn(tr("Failed to cancel running OAuth operation")); 115 } catch (SecurityException e) { 116 Main.error(e); 117 Main.warn(tr("Failed to cancel running OAuth operation")); 118 } catch (IllegalAccessException e) { 111 } catch (NoSuchFieldException | SecurityException | IllegalAccessException e) { 119 112 Main.error(e); 120 113 Main.warn(tr("Failed to cancel running OAuth operation")); … … 146 139 provider.retrieveRequestToken(consumer, ""); 147 140 return OAuthToken.createToken(consumer); 148 } catch(OAuthCommunicationException e){149 if (canceled)150 throw new OsmTransferCanceledException(e);151 throw new OsmOAuthAuthorizationException(e);152 141 } catch(OAuthException e){ 153 142 if (canceled) … … 180 169 provider.retrieveAccessToken(consumer, null); 181 170 return OAuthToken.createToken(consumer); 182 } catch(OAuthCommunicationException e){183 if (canceled)184 throw new OsmTransferCanceledException(e);185 throw new OsmOAuthAuthorizationException(e);186 171 } catch(OAuthException e){ 187 172 if (canceled) … … 441 426 connection.setDoOutput(false); 442 427 connection.connect(); 443 } catch(MalformedURLException e) {444 throw new OsmOAuthAuthorizationException(e);445 428 } catch(IOException e) { 446 429 throw new OsmOAuthAuthorizationException(e); … … 504 487 if (retCode != HttpURLConnection.HTTP_OK) 505 488 throw new OsmOAuthAuthorizationException(tr("Failed to authorize OAuth request ''{0}''", requestToken.getKey())); 506 } catch(MalformedURLException e) {507 throw new OsmOAuthAuthorizationException(e);508 489 } catch(IOException e) { 509 490 throw new OsmOAuthAuthorizationException(e);
Note:
See TracChangeset
for help on using the changeset viewer.