Some error messages tell you exactly what went wrong. Others just shrug.
In gitlab-shell — the Go program that handles Git over SSH for GitLab — a failed JSON parse produced this, and only this:
parsing failed
Enter fullscreen mode
Exit fullscreen mode
No URL. No content type. Nothing about which request had just been parsed. If you were the operator staring at that log line, you knew something had failed and nothing else. Issue #888 in gitlab-shell asked for the obvious thing: when parsing fails, say what you were parsing.
I'm a high-school student in Tunisia, and that issue became my first contribution to GitLab.
The change
The fix itself is small. When the JSON parsing path in gitlab-shell fails now, it logs the request context before returning the error — the content type, and the URL it was talking to — using LabKit, GitLab's structured logging library.
One thing deliberately did not change: the returned error is still exactly parsing failed .…