uskudnik / amazon-glacier-cmd-interface

Command line interface for Amazon Glacier
MIT License
374 stars 100 forks source link

Consistent way of results from diffent subcommands #22

Open offlinehacker opened 11 years ago

offlinehacker commented 11 years ago

We need this so we will be able to write tests.

I recommend a tupple of (error_code, results), where results can be anything. This way we might evolve not only in command line interface but also in usable library.

Depends on: #25

wvmarle commented 11 years ago

If everything went fine, it'll give a result.

If anything went wrong, an exception is raised and we don't even get a return to begin with. So far all exceptions are fatal, but with a different front-end this doesn't have to be of course.

When it comes to tests, it should indeed include forced errors, but then the test should catch the error through a try: except: construction.