Merge lp://staging/~dobey/ubuntuone-client/no-more-notonlineerrors into lp://staging/ubuntuone-client

Proposed by dobey
Status: Merged
Approved by: Guillermo Gonzalez
Approved revision: 240
Merged at revision: not available
Proposed branch: lp://staging/~dobey/ubuntuone-client/no-more-notonlineerrors
Merge into: lp://staging/ubuntuone-client
Diff against target: 55 lines
2 files modified
ubuntuone/oauthdesktop/auth.py (+2/-11)
ubuntuone/oauthdesktop/main.py (+0/-12)
To merge this branch: bzr merge lp://staging/~dobey/ubuntuone-client/no-more-notonlineerrors
Reviewer Review Type Date Requested Status
Guillermo Gonzalez Approve
Rick McBride (community) Approve
Review via email: mp+13018@code.staging.launchpad.net

Commit message

Get rid of NotOnlineError

To post a comment you must log in.
Revision history for this message
Rick McBride (rmcbride) wrote :

Looks good!

review: Approve
Revision history for this message
Guillermo Gonzalez (verterok) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'ubuntuone/oauthdesktop/auth.py'
2--- ubuntuone/oauthdesktop/auth.py 2009-10-07 15:09:56 +0000
3+++ ubuntuone/oauthdesktop/auth.py 2009-10-07 19:40:21 +0000
4@@ -45,13 +45,6 @@
5 class NoAccessToken(Exception):
6 """No access token available."""
7
8-class ConsumerKeyInvalid(Exception):
9- """OAuth said the consumer key was invalid."""
10-class UnknownLoginError(Exception):
11- """An OAuth request failed for some reason."""
12-class NotOnlineError(Exception):
13- """There is no network connection."""
14-
15 # NetworkManager State constants
16 NM_STATE_UNKNOWN = 0
17 NM_STATE_ASLEEP = 1
18@@ -291,12 +284,10 @@
19 else:
20 # NM is not connected: fail
21 logger.debug("We are not online")
22- raise NotOnlineError()
23
24- def got_error():
25+ def got_error(error):
26 """Handler for D-Bus errors when calling state()."""
27- logger.debug("Received D-Bus error")
28- raise NotOnlineError()
29+ logger.error("Unable to contact NetworkManager")
30
31 iface.state(reply_handler=got_state, error_handler=got_error)
32
33
34=== modified file 'ubuntuone/oauthdesktop/main.py'
35--- ubuntuone/oauthdesktop/main.py 2009-09-08 13:28:01 +0000
36+++ ubuntuone/oauthdesktop/main.py 2009-10-07 19:40:21 +0000
37@@ -117,18 +117,6 @@
38 """Deal with errors returned from auth process"""
39 logger.debug("Error returned from auth process")
40 self.dbus_object.currently_authing = False # don't block future requests
41- from ubuntuone.oauthdesktop.auth import (
42- ConsumerKeyInvalid, UnknownLoginError, NotOnlineError)
43- r = failure.trap(ConsumerKeyInvalid, UnknownLoginError, NotOnlineError)
44- logger.debug("Error was: %s", r)
45- if self.use_libnotify and pynotify:
46- if r == ConsumerKeyInvalid:
47- pynotify.Notification("UbuntuOne",
48- "This application is not allowed to " +\
49- "connect to one.ubuntu.com").show()
50- elif r == UnknownLoginError:
51- pynotify.Notification("UbuntuOne",
52- "There was a problem connecting to one.ubuntu.com").show()
53
54 def get_config_urls(self, realm):
55 """Look up the URLs to use in the config file"""

Subscribers

People subscribed via source and target branches