From dc65347b838b4b55f649cc780b33d51f5e8cb5bf Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 20 Feb 2017 15:14:56 -0400 Subject: Run wget with -nv instead of -q, so it will display HTTP errors. This adds one extra line of output when a download is successful, after the progress bar. I don't much like that, but wget does not provide a way to show HTTP errors without it. --- ...comment_1_0eeb859b57d4dc8a3c9c9c3c4f70bb45._comment | 16 ++++++++++++++++ ...comment_2_82b851629c695084cbf62e2b636bcc91._comment | 18 ++++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 doc/todo/more_of_diagnostic_information_in_case_of_failures_into_returned_json/comment_1_0eeb859b57d4dc8a3c9c9c3c4f70bb45._comment create mode 100644 doc/todo/more_of_diagnostic_information_in_case_of_failures_into_returned_json/comment_2_82b851629c695084cbf62e2b636bcc91._comment (limited to 'doc/todo') diff --git a/doc/todo/more_of_diagnostic_information_in_case_of_failures_into_returned_json/comment_1_0eeb859b57d4dc8a3c9c9c3c4f70bb45._comment b/doc/todo/more_of_diagnostic_information_in_case_of_failures_into_returned_json/comment_1_0eeb859b57d4dc8a3c9c9c3c4f70bb45._comment new file mode 100644 index 000000000..80dfe504b --- /dev/null +++ b/doc/todo/more_of_diagnostic_information_in_case_of_failures_into_returned_json/comment_1_0eeb859b57d4dc8a3c9c9c3c4f70bb45._comment @@ -0,0 +1,16 @@ +[[!comment format=mdwn + username="joey" + subject="""comment 1""" + date="2017-02-20T18:50:18Z" + content=""" +Probably wget is just failing to download the url sometimes. +Eg, `git annex addurl http://localhost/dne` fails with the same not useful +output. + +wget is run with -q, which is the only way to turn off all its informational +messages, but unfortunately that also turns off display of HTTP error messages. + +Using -nv instead of -q would display HTTP errors, +but also 1 extra line of output once the download is complete. +I suppose that's worth the trade-off. +"""]] 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 new file mode 100644 index 000000000..b7c65c51b --- /dev/null +++ b/doc/todo/more_of_diagnostic_information_in_case_of_failures_into_returned_json/comment_2_82b851629c695084cbf62e2b636bcc91._comment @@ -0,0 +1,18 @@ +[[!comment format=mdwn + username="joey" + subject="""comment 2""" + date="2017-02-20T19:15:18Z" + content=""" +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. +(curl also outputs HTTP errors to stdout too, so it's no better) + +Short of using a HTTP library for url downloads in --json mode, +I don't see a way to fix this. 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. +""]] -- cgit v1.2.3