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
Use pre-defined error instances #13
Comments
Hi there, This repository is kind of suspend for maintenance, but may continue in the future. Hmm... so the point is I don't want waste your time. 😓 |
Would you recommend not using this? Do you have suggestions for an alternative? Should I start my own fork? :) |
Code most likely is not going to change.
Yes, I think so. |
Very well, thanks for letting me know, and thanks for the great work so far! |
Gogs currently is using git-shell, may come back to manipulate internal objects after 1.0 release when we got enough time |
Hiya, right now there are a bunch of
errors.New(fmt.Sprintf(...))
all over the code, and the string is often dynamic so it makes it hard to compare conditions programmatically.For instance, when an object is not found: https://github.com/gogits/git/blob/16f4de6a9d8a6695826ef4118f58dff85174b335/repo_object.go#L81
I propose we pull out at least the more common errors into package variables so that the conditions can be compared against. We can still make the Error() messages dynamically generated, so the output will stay the same.
(Happy to work on a PR for this, just let me know!)
The text was updated successfully, but these errors were encountered: