From: Adam Sampson Date: Sun, 12 Oct 2003 00:12:05 +0000 (+0000) Subject: Print a more useful error message if the statefile can't be read. X-Git-Tag: v1.4~2 X-Git-Url: http://git.ozo.com/?a=commitdiff_plain;h=4984a743bb4b5b90a289d50e73d8d8015d18b491;p=rawdog%2F.git Print a more useful error message if the statefile can't be read. --- diff --git a/rawdoglib/rawdog.py b/rawdoglib/rawdog.py index dfa0349..aeaf384 100644 --- a/rawdoglib/rawdog.py +++ b/rawdoglib/rawdog.py @@ -591,7 +591,12 @@ def main(argv): return 1 persister = Persister("state", Rawdog) - rawdog = persister.load() + try: + rawdog = persister.load() + except: + print "An error occurred while reading state from ~/.rawdog/state." + print "This usually means the file is corrupt, and removing it will fix the problem." + return 1 for o, a in optlist: if o in ("-u", "--update"):