Page MenuHomePhabricator

Return Git HTTP error messages in an HTTP header
ClosedPublic

Authored by epriestley on Jan 26 2021, 11:58 PM.

Details

Summary

Ref T13590. Currently, when you encounter a HTTP error in Git, there is no apparent way to make the client show any additional useful information. In particular, the response body is ignored.

We can partially get around this by putting the information in an "X-Phabricator-Message: ..." HTTP header, which is visible with "GIT_CURL_VERBOSE=1 git ...". Users won't normally know to look here, but it's still better than nothing.

Test Plan
  • Ran "GIT_CURL_VERBOSE=1 git fetch" against a Phabricator HTTP URI that returned a HTTP/500 error.
    • Before: no clue what happened on the client.
    • After: client shows useful message in the "X-Phabricator-Message" header in debug output.

Diff Detail

Repository
rP Phabricator
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.