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

Handle exceptions better #4

Open
jethrocarr opened this issue May 10, 2015 · 2 comments
Open

Handle exceptions better #4

jethrocarr opened this issue May 10, 2015 · 2 comments

Comments

@jethrocarr
Copy link
Owner

Currently Pupistry is a bit of a mix of using return codes and using exceptions. We should fix it to properly do exception handling everywhere and dump the use of return codes for success/failure.

@mexisme
Copy link

mexisme commented Jul 15, 2015

As a first step, you may want to create an Exception object that encapsulates the return codes, and implement helper methods that allow it to be used in-place throughout your code.
e.g.

def ==(other)
  other == @err_code
end

I have a feeling something similar may have already been written in one of the IO classes that you could sub-class + extend effectively.

@jethrocarr
Copy link
Owner Author

Good idea - got to do something, I hacked in using return codes everywhere and every time I look at the code it now fills me with unlimited amounts of shame and regret.

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

2 participants