@@ -412,10 +412,16 @@ static void gh__response_status__set_from_slot(
412
412
strbuf_addf (& status -> error_message , "%s (curl)" ,
413
413
curl_easy_strerror (status -> curl_code ));
414
414
status -> ec = GH__ERROR_CODE__CURL_ERROR ;
415
+
416
+ trace2_data_string ("gvfs-helper" , NULL ,
417
+ "error/curl" , status -> error_message .buf );
415
418
} else {
416
419
strbuf_addf (& status -> error_message , "HTTP %ld Unexpected" ,
417
420
status -> response_code );
418
421
status -> ec = GH__ERROR_CODE__HTTP_UNEXPECTED_CODE ;
422
+
423
+ trace2_data_string ("gvfs-helper" , NULL ,
424
+ "error/http" , status -> error_message .buf );
419
425
}
420
426
421
427
if (status -> ec != GH__ERROR_CODE__OK )
@@ -2035,7 +2041,7 @@ static enum gh__error_code do_sub_cmd__get(int argc, const char **argv)
2035
2041
}
2036
2042
2037
2043
/*
2038
- * Handle the 'get' command when in "server mode". Only call error()
2044
+ * Handle the 'get' command when in "server mode". Only call error() and set ec
2039
2045
* for hard errors where we cannot communicate correctly with the foreground
2040
2046
* client process. Pass any actual data errors (such as 404's or 401's from
2041
2047
* the fetch back to the client process.
@@ -2107,10 +2113,15 @@ static enum gh__error_code do_server_subprocess_get(void)
2107
2113
goto cleanup ;
2108
2114
}
2109
2115
2116
+ /*
2117
+ * We only use status.ec to tell the client whether the request
2118
+ * was complete, incomplete, or had IO errors. We DO NOT return
2119
+ * this value to our caller.
2120
+ */
2110
2121
err = 0 ;
2111
- if (ec == GH__ERROR_CODE__OK )
2122
+ if (status . ec == GH__ERROR_CODE__OK )
2112
2123
err = packet_write_fmt_gently (1 , "ok\n" );
2113
- else if (ec == GH__ERROR_CODE__HTTP_404 )
2124
+ else if (status . ec == GH__ERROR_CODE__HTTP_404 )
2114
2125
err = packet_write_fmt_gently (1 , "partial\n" );
2115
2126
else
2116
2127
err = packet_write_fmt_gently (1 , "error %s\n" ,
@@ -2337,6 +2348,7 @@ int cmd_main(int argc, const char **argv)
2337
2348
usage_with_options (main_usage , main_options );
2338
2349
2339
2350
trace2_cmd_name ("gvfs-helper" );
2351
+ packet_trace_identity ("gvfs-helper" );
2340
2352
2341
2353
setup_git_directory_gently (NULL );
2342
2354
0 commit comments