diff options
author | Wade Brainerd <wadetb@gmail.com> | 2009-09-30 03:11:56 (GMT) |
---|---|---|
committer | Aleksey Lim <alsroot@member.fsf.org> | 2009-12-20 13:17:05 (GMT) |
commit | 7148f1a664963cbfc991fdc67774d27ac6f30bca (patch) | |
tree | 360524e82c85e9034847bb2faac004f5fb304917 /bin/copy-to-journal | |
parent | ba0a546d53bb10aa8540f9725488c8f7d0dde250 (diff) |
Better error messages in copy-from-journal and copy-to-journal when the datastore cannot be reached. (This is common when the scripts are run from another user.)
Also removed a debug print and made the error messages a little more consistent.
Diffstat (limited to 'bin/copy-to-journal')
-rwxr-xr-x | bin/copy-to-journal | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/bin/copy-to-journal b/bin/copy-to-journal index cf2cf20..d6ae6f3 100755 --- a/bin/copy-to-journal +++ b/bin/copy-to-journal @@ -11,6 +11,7 @@ import sys import os import optparse from gettext import gettext as _ +import dbus if os.path.exists("/tmp/olpc-session-bus"): os.environ["DBUS_SESSION_BUS_ADDRESS"] = "unix:path=/tmp/olpc-session-bus" @@ -88,5 +89,10 @@ if __name__ == "__main__": entry.destroy() + except dbus.DBusException: + print 'ERROR: Unable to connect to the datastore.\n'\ + 'Check that you are running in the same environment as the '\ + 'datastore service.' + except Exception, e: - print 'Error: %s' % (e) + print 'ERROR: %s' % (e) |