-
Notifications
You must be signed in to change notification settings - Fork 772
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
Improve error handling #416
Labels
Comments
Printing errors using |
@kadel taking this up! |
FYI: I have done some work at #462 Also, I will be using the github.com/pkg/errors package to wrap and push the errors up the call stack. Just keeping everyone in the loop. |
concaf
added a commit
to concaf/kompose
that referenced
this issue
Mar 7, 2017
This commit refactors the code to remove more or less all occurences of logrus.Fatalf() from the code under pkg/ except for app.go where all the errors are being handled currently. This is being done since random logrus.Fatalf() calls all around the code was making handling the errors, unit testing and troubleshooting a bit more painful. logrus.Fatalf() calls are either replaced by return errors.New("new error") or return errors.Wrap(err, "annonate error") calls, and the function signatures are accordingly changed to accomodate the new return values. The unit tests which previously used to check if logrus.Fatalf() calls worked fine have also been fixed to only check for errors now. Fixes kubernetes#416
concaf
added a commit
to concaf/kompose
that referenced
this issue
Mar 15, 2017
This commit refactors the code to remove more or less all occurences of logrus.Fatalf() from the code under pkg/ except for app.go where all the errors are being handled currently. This is being done since random logrus.Fatalf() calls all around the code was making handling the errors, unit testing and troubleshooting a bit more painful. logrus.Fatalf() calls are either replaced by return errors.New("new error") or return errors.Wrap(err, "annonate error") calls, and the function signatures are accordingly changed to accomodate the new return values. The unit tests which previously used to check if logrus.Fatalf() calls worked fine have also been fixed to only check for errors now. Fixes kubernetes#416
Merged
procrypt
pushed a commit
to procrypt/kompose
that referenced
this issue
Mar 20, 2017
This commit refactors the code to remove more or less all occurences of logrus.Fatalf() from the code under pkg/ except for app.go where all the errors are being handled currently. This is being done since random logrus.Fatalf() calls all around the code was making handling the errors, unit testing and troubleshooting a bit more painful. logrus.Fatalf() calls are either replaced by return errors.New("new error") or return errors.Wrap(err, "annonate error") calls, and the function signatures are accordingly changed to accomodate the new return values. The unit tests which previously used to check if logrus.Fatalf() calls worked fine have also been fixed to only check for errors now. Fixes kubernetes#416
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In some places like for example here we are printing errors using
logrus.Fatalf
deep inside code.It would be better if function returned error that can be processed outside of this function (higher in call stack). Code will be cleaner and it will be easier to write unit tests.
I think that we should invest some time in cleaning all error handling in Kompose codebase.
The text was updated successfully, but these errors were encountered: