Skip to content

Commit

Permalink
Better presentation of update failure / save
Browse files Browse the repository at this point in the history
  • Loading branch information
kfsone committed Dec 23, 2014
1 parent b2255bf commit 58a27f2
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions commands/update_cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,12 @@ def editUpdate(tdb, cmdenv, stationID):
tmpPath.unlink()
tmpPath = None

finally:
except Exception as e:
print("ERROR:", e)
print()
print("*** YOUR UPDATES WILL BE SAVED AS {} ***".format(
"prices.last"
))
# Save a copy
if absoluteFilename and tmpPath:
saveTemporaryFile(tmpPath)
Expand All @@ -357,12 +362,12 @@ def guidedUpdate(tdb, cmdenv):
tmpPath = None

except Exception as e:
print("*** ERROR ENCOUNTERED ***")
print("ERROR:", e)
print()
print("*** YOUR UPDATES WILL BE SAVED AS {} ***".format(
"prices.last"
))
raise
finally:

if tmpPath:
saveTemporaryFile(tmpPath)

Expand Down

0 comments on commit 58a27f2

Please sign in to comment.