-
Notifications
You must be signed in to change notification settings - Fork 8
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
787 improve ssh access error handling #873
Conversation
end | ||
|
||
def generate_message | ||
<<-ERROR.squish |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can't use squish
here because not all callers have the rails environment loaded
This includes some error classes, a default no-redirections-limit constant (which uses the value 1) and a specific TooManyRedirects error class, which also contains the previous response which we received before it all went to hell.
Also produce more useful error message inside of the log (server-side).
When ssh-access querying for permissions fails for HTTP related reasons the git-push user should be informed of the situation instead of being attacked by a ruby stacktrace.
end | ||
puts <<-ERROR | ||
We encountered a system error while processing your | ||
push attempt. The push was not attempted and your data |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"... processing your push attempt. The push was not attempted"
I'm no expert on the english language, but that sounds a little weird to me. Maybe replace the last "not attempted" by "not completed", "not finished" or "aborted".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not entirely sure why you're objecting (attempted). Technically it is true: we did not attempt to actually push data from the client to server (or vice versa).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would prefer something like "The push command was not processed"
Not directly concerining your changes (while still concerning messages to the user), but in https://github.com/ontohub/ontohub/blob/787-improve_ssh_access_error_handling/git/lib/git_shell.rb#L38 you don't use |
Mh, i guess the only reason is that i didn't notice (the To be honest, i'm not entirely sure if it makes a difference, as i do not know if it would actually print to standard error on the client (as there is a network connection and git-handling between printing the message and the user receiving it). This could/should probably investigated. However we shouldn't use |
I made the adjustments in the error text. I've also replaced "push" with "git-interaction" and "git command", as at least one of error messages could also be triggered by a I have also changed the puts calls from implicit |
👍 |
…dling 787 improve ssh access error handling
Shall improve error handling of git/ssh.
It fixes #787.
The following elements are added: