@@ -414,10 +414,16 @@ static void gh__response_status__set_from_slot(
414
414
strbuf_addf (& status -> error_message , "%s (curl)" ,
415
415
curl_easy_strerror (status -> curl_code ));
416
416
status -> ec = GH__ERROR_CODE__CURL_ERROR ;
417
+
418
+ trace2_data_string ("gvfs-helper" , NULL ,
419
+ "error/curl" , status -> error_message .buf );
417
420
} else {
418
421
strbuf_addf (& status -> error_message , "HTTP %ld Unexpected" ,
419
422
status -> response_code );
420
423
status -> ec = GH__ERROR_CODE__HTTP_UNEXPECTED_CODE ;
424
+
425
+ trace2_data_string ("gvfs-helper" , NULL ,
426
+ "error/http" , status -> error_message .buf );
421
427
}
422
428
423
429
if (status -> ec != GH__ERROR_CODE__OK )
@@ -2041,7 +2047,7 @@ static enum gh__error_code do_sub_cmd__get(int argc, const char **argv)
2041
2047
}
2042
2048
2043
2049
/*
2044
- * Handle the 'get' command when in "server mode". Only call error()
2050
+ * Handle the 'get' command when in "server mode". Only call error() and set ec
2045
2051
* for hard errors where we cannot communicate correctly with the foreground
2046
2052
* client process. Pass any actual data errors (such as 404's or 401's from
2047
2053
* the fetch back to the client process.
@@ -2113,10 +2119,15 @@ static enum gh__error_code do_server_subprocess_get(void)
2113
2119
goto cleanup ;
2114
2120
}
2115
2121
2122
+ /*
2123
+ * We only use status.ec to tell the client whether the request
2124
+ * was complete, incomplete, or had IO errors. We DO NOT return
2125
+ * this value to our caller.
2126
+ */
2116
2127
err = 0 ;
2117
- if (ec == GH__ERROR_CODE__OK )
2128
+ if (status . ec == GH__ERROR_CODE__OK )
2118
2129
err = packet_write_fmt_gently (1 , "ok\n" );
2119
- else if (ec == GH__ERROR_CODE__HTTP_404 )
2130
+ else if (status . ec == GH__ERROR_CODE__HTTP_404 )
2120
2131
err = packet_write_fmt_gently (1 , "partial\n" );
2121
2132
else
2122
2133
err = packet_write_fmt_gently (1 , "error %s\n" ,
@@ -2344,6 +2355,7 @@ int cmd_main(int argc, const char **argv)
2344
2355
usage_with_options (main_usage , main_options );
2345
2356
2346
2357
trace2_cmd_name ("gvfs-helper" );
2358
+ packet_trace_identity ("gvfs-helper" );
2347
2359
2348
2360
setup_git_directory_gently (NULL );
2349
2361
0 commit comments