@@ -256,7 +256,7 @@ private Single<List<PathMetadata>> queryRemoteCache(
256256 return toSingle (() -> remoteCache .findMissingDigests (context , digestsToQuery ), executor )
257257 .onErrorResumeNext (
258258 error -> {
259- reporterUploadError (error );
259+ reportUploadError (error , null , null );
260260 // Assuming all digests are missing if failed to query
261261 return Single .just (ImmutableSet .copyOf (digestsToQuery ));
262262 })
@@ -267,13 +267,19 @@ private Single<List<PathMetadata>> queryRemoteCache(
267267 });
268268 }
269269
270- private void reporterUploadError (Throwable error ) {
270+ private void reportUploadError (Throwable error , Path path , Digest digest ) {
271271 if (error instanceof CancellationException ) {
272272 return ;
273273 }
274274
275- String errorMessage =
276- "Uploading BEP referenced local files: " + grpcAwareErrorMessage (error , verboseFailures );
275+ String errorMessage = "Uploading BEP referenced local file" ;
276+ if (path != null ) {
277+ errorMessage += " " + path ;
278+ }
279+ if (digest != null ) {
280+ errorMessage += " " + digest ;
281+ }
282+ errorMessage += ": " + grpcAwareErrorMessage (error , verboseFailures );
277283
278284 reporter .handle (Event .warn (errorMessage ));
279285 }
@@ -298,11 +304,11 @@ private Single<List<PathMetadata>> uploadLocalFiles(
298304 path .isDirectory (),
299305 // set remote to true so the PathConverter will use bytestream://
300306 // scheme to convert the URI for this file
301- /*remote=*/ true ,
307+ /* remote= */ true ,
302308 path .isOmitted ()))
303309 .onErrorResumeNext (
304310 error -> {
305- reporterUploadError (error );
311+ reportUploadError (error , path . getPath (), path . getDigest () );
306312 return Single .just (path );
307313 });
308314 })
@@ -329,7 +335,7 @@ private Single<PathConverter> upload(Set<Path> files) {
329335 try {
330336 return readPathMetadata (file );
331337 } catch (IOException e ) {
332- reporterUploadError ( e );
338+ reportUploadError ( e , file , null );
333339 return new PathMetadata (
334340 file ,
335341 /* digest= */ null ,
0 commit comments