Skip to content

Commit

Permalink
Avoid pointless exception wrapping.
Browse files Browse the repository at this point in the history
SpawnRunner#exec is already allowed to return a ForbiddenActionInputException, which is converted into a UserExecException in AbstractSpawnStrategy#exec. The wrapping provides no useful context, as this error occurs during input prefetching, which is independent from sandboxing.

PiperOrigin-RevId: 662558149
Change-Id: Ifd6bf078f73f5089661a0b570c40a20e8e42b41d
  • Loading branch information
tjgq authored and copybara-github committed Aug 13, 2024
1 parent 4e184e2 commit 8206a98
Showing 1 changed file with 1 addition and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public AbstractSandboxSpawnRunner(CommandEnvironment cmdEnv) {

@Override
public final SpawnResult exec(Spawn spawn, SpawnExecutionContext context)
throws ExecException, InterruptedException {
throws ExecException, InterruptedException, ForbiddenActionInputException {
ActionExecutionMetadata owner = spawn.getResourceOwner();
context.report(SpawnSchedulingEvent.create(getName()));

Expand All @@ -116,11 +116,6 @@ public final SpawnResult exec(Spawn spawn, SpawnExecutionContext context)
SandboxHelpers.createFailureDetail(
"I/O exception during sandboxed execution", Code.EXECUTION_IO_EXCEPTION);
throw new UserExecException(e, failureDetail);
} catch (ForbiddenActionInputException e) {
FailureDetail failureDetail =
SandboxHelpers.createFailureDetail(
"Forbidden input found during sandboxed execution", Code.FORBIDDEN_INPUT);
throw new UserExecException(e, failureDetail);
}
}

Expand Down

0 comments on commit 8206a98

Please sign in to comment.