-
Notifications
You must be signed in to change notification settings - Fork 27
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
Refactor vroom Failures to not be python Exceptions #74
Comments
the "railway oriented" design would be nice to use here (http://zohaib.me/railway-programming-pattern-in-elixir/ is a good writeup, e.g.) |
The thrust of it (for python programmers, at least) seems to be to pass along an explicit state representing any errors, which is what I had in mind. The description sounds like error monads. The helper macros and stuff may not translate well into python, but we can try to keep concerns separated and at least have some strong conventions in the code. |
right, the attempts i've seen to implement an error monad directly in python end up looking rather ugly, but as a design strategy it seems to be the best way to do this. still trying to see if there's a way to do this in one small place and slowly expand it through the code, rather than do it all at once. |
FYI, I found a bug related to us getting confused and passing an Exception type as a failure: Line 121 in f8b762c
I discovered this blows up if I do hit some error with the fake shell with errors about missing a FakeShellNotWorking.IsSignificant method, since it doesn't subclass Failure or define its own implementation of IsSignificant. |
The code currently raises vroom Failures as Exceptions, with a lot of code to catch, collect, and continue and potentially really weird behavior if there are mistakes in the code.
We should restructure the code so Failures are just normal return values from functions instead of raised Exceptions.
The text was updated successfully, but these errors were encountered: