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

Pyspades eats generic errors from commands and gives cryptic unrelated error messages #281

Open
GoogleCodeExporter opened this issue Aug 17, 2015 · 1 comment

Comments

@GoogleCodeExporter
Copy link
Contributor

The reason pyspades does it this way to begin with is because if a user types 
an invalid number of arguments for a given command, it will throw a TypeError.

However, TypeError is a very common error in commands, and consuming it every 
time it occurs makes debugging difficult.

Instead of catching this error which overlaps with many other "real" errors, 
why not prevent it from occurring in the first place?

Attached is a patch for commands.py that validates parameter count (including 
support for variable length *args) with inspect.getargspec(). The result is 
cached in the function object itself to avoid any possible "inspection 
overhead."

Original issue reported on code.google.com by [email protected] on 10 Aug 2012 at 6:02

Attachments:

@GoogleCodeExporter
Copy link
Contributor Author

The previous patch has been working for me, save for two bugs:

1. It did not account for optional args, so it prevented valid calls.
2. It got the wrong information about @admin commands.

Attached is another patch that addresses these issues and is hopefully more 
legible.

Original comment by [email protected] on 13 Aug 2012 at 1:09

Attachments:

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

No branches or pull requests

1 participant