Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure readable errors are printed by seash, not tracebacks... #84

Open
JustinCappos opened this issue Feb 10, 2015 · 1 comment
Open

Comments

@JustinCappos
Copy link
Contributor

Right now, doing a few basic things wrong in seash results in tracebacks. It would be better to catch expected errors and print nicer error messages.

For example:

Justins-MacBook-Air:seattle_demokit justincappos$ python seash.py

  • You can list all available seash modules using 'show modules' command.

Enabled modules: clearinghouse, factoids, geoip, modules, variables

!> loadkeys ../abc
Traceback (most recent call last):
File "seash.py", line 267, in command_loop
File "/Users/justincappos/Downloads/seattle_demokit/seash_dictionary.py", line 2109, in command_dispatch
File "/Users/justincappos/Downloads/seattle_demokit/command_callbacks.py", line 1534, in loadkeys_keyname
File "/Users/justincappos/Downloads/seattle_demokit/rsa", line 719, in rsa_file_to_privatekey
File "/Users/justincappos/Downloads/seattle_demokit/emulfile.py", line 179, in emulated_open
File "/Users/justincappos/Downloads/seattle_demokit/emulfile.py", line 291, in init
FileNotFoundError: Cannot openfile non-existent file "../abc.privatekey" without creating it!
!>

dubdubdub@%all !> upload aksd
Traceback (most recent call last):
File "seash.py", line 267, in command_loop
File "/Users/justincappos/Downloads/seattle_demokit/seash_dictionary.py", line 2109, in command_dispatch
File "/Users/justincappos/Downloads/seattle_demokit/command_callbacks.py", line 1864, in upload_filename
IOError: [Errno 2] No such file or directory: 'aksd'
dubdubdub@%all !>

@aaaaalbert
Copy link
Contributor

Proposed fix in 5b36d1f. You may try it out my branch like so,

git clone https://github.com/SeattleTestbed/seash.git -b beautify-error-messages

followed by the usual init/build steps.

Things I tested, with "NX" refering to a non-existant file:

loadpub NX
loadpub a_key

loadpriv NX
loadpriv a_key

loadkeys NX

# Next up, try loading a key pair with only one of the keys available
loadkeys only_pub
loadkeys only_priv

on %all
upload NX
run NX

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants