diff options
author | Joey Hess <joeyh@joeyh.name> | 2017-02-20 15:59:55 -0400 |
---|---|---|
committer | Joey Hess <joeyh@joeyh.name> | 2017-02-20 16:09:32 -0400 |
commit | d6fc0ab29009018b8639a911b876678721506f6c (patch) | |
tree | af05a6956b7de5a7add81b4d5ddc9df4e3cde971 /doc | |
parent | 5099cc747ac8c6b2d9a873c4a7051c60b8541c41 (diff) |
make curl show http errors to stderr
* Run curl with -S, so HTTP errors are displayed, even when
it's otherwise silent.
* When downloading in --json or --quiet mode, use curl in preference
to wget, since curl is able to display only errors to stderr, unlike
wget.
This does mean that downloadQuiet is only silent on stdout, not necessarily
on stderr, which affects a couple other calls of it. For example,
downloading the .git/config of a http remote may show an error message now,
perhaps with slightly suboptimal formatting due to other output.
Diffstat (limited to 'doc')
2 files changed, 7 insertions, 4 deletions
diff --git a/doc/todo/more_of_diagnostic_information_in_case_of_failures_into_returned_json.mdwn b/doc/todo/more_of_diagnostic_information_in_case_of_failures_into_returned_json.mdwn index b9283ae54..3e9c30970 100644 --- a/doc/todo/more_of_diagnostic_information_in_case_of_failures_into_returned_json.mdwn +++ b/doc/todo/more_of_diagnostic_information_in_case_of_failures_into_returned_json.mdwn @@ -18,3 +18,5 @@ ATM I am experiencing sporadic failures of the batched git annex addurl call -- besides me blindly trying to re-run it e.g. 3 times and only then declare total failure, I wondered if json output could provide more information (if any known) about the failure... e.g. if a custom remote crashed/errorred (I guess the case here due to "from datalad") -- what was stderr/exit code for that process if crashed/ERROR msg... if wget -- what was stderr there [[!meta name=yoh]] + +> Switched to curl with -sS in --json mode. [[done]] I suppose. --[[Joey]] diff --git a/doc/todo/more_of_diagnostic_information_in_case_of_failures_into_returned_json/comment_2_82b851629c695084cbf62e2b636bcc91._comment b/doc/todo/more_of_diagnostic_information_in_case_of_failures_into_returned_json/comment_2_82b851629c695084cbf62e2b636bcc91._comment index 40935530e..0ece7ca77 100644 --- a/doc/todo/more_of_diagnostic_information_in_case_of_failures_into_returned_json/comment_2_82b851629c695084cbf62e2b636bcc91._comment +++ b/doc/todo/more_of_diagnostic_information_in_case_of_failures_into_returned_json/comment_2_82b851629c695084cbf62e2b636bcc91._comment @@ -3,13 +3,14 @@ subject="""comment 2""" date="2017-02-20T19:15:18Z" content=""" +It seems there is no way to get only errors on +stderr with wget; the choice is between no output, and a mixture of errors +and informational messages on stderr. In --json or --quiet mode, only +errors should be output to stderr. + In general, the --json output does include a "note" with any available message about why an operation failed. -Since wget outputs HTTP errors to stdout, there's no way to capture -the actual message for json, and so swiching to wget -nv won't improve -the json, since in json mode wget is run with -q. - It would not be hard to use a HTTP library and propagate the HTTP errors into the json "note", but it might be hard to get resumption of partial downloads to work as well with a HTTP library as it works with wget/curl. |