Page MenuHomePhabricator

Return Git HTTP error messages in an HTTP header
ClosedPublic

Authored by epriestley on Jan 26 2021, 11:58 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Apr 25, 1:18 AM
Unknown Object (File)
Thu, Apr 18, 4:50 AM
Unknown Object (File)
Tue, Apr 16, 8:59 AM
Unknown Object (File)
Dec 27 2023, 1:40 PM
Unknown Object (File)
Dec 25 2023, 11:04 AM
Unknown Object (File)
Dec 22 2023, 3:27 AM
Unknown Object (File)
Dec 20 2023, 3:45 PM
Unknown Object (File)
Dec 19 2023, 5:49 PM
Subscribers
None

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
Branch
http1
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 25043
Build 34553: Run Core Tests
Build 34552: arc lint + arc unit