@@ -166,8 +166,7 @@ static ErrorProcessingResult processErrors(
166166 // turns out to be with execution.
167167 boolean hasAnalysisError = true ;
168168 ViewCreationFailedException noKeepGoingAnalysisExceptionAspect = null ;
169- DetailedExitCode detailedExitCode = null ;
170- Throwable undetailedCause = null ;
169+ DetailedExitCode representativeExecutionDetailedExitCode = null ;
171170 Map <ActionAnalysisMetadata , ConflictException > actionConflicts = new HashMap <>();
172171 for (Map .Entry <SkyKey , ErrorInfo > errorEntry : result .errorMap ().entrySet ()) {
173172 SkyKey errorKey = getErrorKey (errorEntry );
@@ -275,17 +274,21 @@ static ErrorProcessingResult processErrors(
275274 actionConflicts .putAll (tlce .getTransitiveActionConflicts ());
276275 continue ;
277276 } else if (isExecutionException (cause )) {
278- detailedExitCode =
277+ DetailedExitCode detailedExitCode = DetailedException .getDetailedExitCode (cause );
278+ if (detailedExitCode == null ) {
279+ detailedExitCode = createDetailedExitCodeForUndetailedExecutionCause (result , cause );
280+ }
281+ representativeExecutionDetailedExitCode =
279282 DetailedExitCodeComparator .chooseMoreImportantWithFirstIfTie (
280- detailedExitCode , (( DetailedException ) cause ). getDetailedExitCode () );
283+ representativeExecutionDetailedExitCode , detailedExitCode );
281284 rootCauses =
282285 cause instanceof ActionExecutionException
283286 ? ((ActionExecutionException ) cause ).getRootCauses ()
284287 : NestedSetBuilder .emptySet (Order .STABLE_ORDER );
285288 hasAnalysisError = false ;
286289 } else {
287- // TODO(ulfjack): Report something!
288- undetailedCause = cause ;
290+ BugReport . logUnexpected (
291+ cause , "Unexpected cause encountered while evaluating: %s" , errorKey ) ;
289292 }
290293
291294 if (!inTest ) {
@@ -325,12 +328,11 @@ static ErrorProcessingResult processErrors(
325328 throw noKeepGoingAnalysisExceptionAspect ;
326329 }
327330
328- if (includeExecutionPhase && detailedExitCode == null ) {
329- detailedExitCode = createDetailedExitCodeForUndetailedExecutionCause (result , undetailedCause );
330- }
331-
332331 return ErrorProcessingResult .create (
333- hasLoadingError , hasAnalysisError , ImmutableMap .copyOf (actionConflicts ), detailedExitCode );
332+ hasLoadingError ,
333+ hasAnalysisError ,
334+ ImmutableMap .copyOf (actionConflicts ),
335+ representativeExecutionDetailedExitCode );
334336 }
335337
336338 private static SkyKey getErrorKey (Entry <SkyKey , ErrorInfo > errorEntry ) {
@@ -631,14 +633,14 @@ static void rethrow(
631633
632634 private static DetailedExitCode createDetailedExitCodeForUndetailedExecutionCause (
633635 EvaluationResult <?> result , Throwable undetailedCause ) {
634- // TODO(b/227660368): These warning logs should be a bug report, but tests currently fail.
635636 if (undetailedCause == null ) {
636- logger . atWarning (). log ("No exceptions found despite error in %s" , result );
637+ BugReport . sendBugReport ("No exceptions found despite error in %s" , result );
637638 return createDetailedExecutionExitCode (
638639 "keep_going execution failed without an action failure" ,
639640 Execution .Code .NON_ACTION_EXECUTION_FAILURE );
640641 }
641- logger .atWarning ().withCause (undetailedCause ).log ("No detailed exception found in %s" , result );
642+ BugReport .sendBugReport (
643+ new IllegalStateException ("No detailed exception found in " + result , undetailedCause ));
642644 return createDetailedExecutionExitCode (
643645 "keep_going execution failed without an action failure: "
644646 + undetailedCause .getMessage ()
0 commit comments