SeattleTestbed / seash

Interactive vessel management tool
MIT License
0 stars 10 forks source link

Improve `savestate` error handling #89

Open aaaaalbert opened 9 years ago

aaaaalbert commented 9 years ago

Shell log from seash build a097c9559cb2d7f5ec4259062b46487d7b14ff50.

First problem: You cannot savestate before having loaded at least a pubkey, and work as that identity. The error message should indicate that (and not a coding error).

$ python seash.py
Enabled modules:  

 !> savestate NO_KEYS_LOADED
Error saving state: 'cannot concatenate 'str' and 'NoneType' objects'.
 !>

Problem 2: The error message is unspecific when using savestate to a write-protected file. (Similar issues might exist for other seash commands using write.)

$ touch write_protected_file
$ chmod a-w write_protected_file
$ python seash.py
Enabled modules:  

 !> loadkeys some_id
 !> as some_id 
some_id@ !> savestate write_protected_file 
Error saving state: 'local variable 'state_obj' referenced before assignment'.
some_id@ !>