cake-build / cake-build/cake

Tool.Run should make stdout and stderr available on failure

Open
#2,460 4 comments 2 reactions 0 assignees View on GitHub
Help wanted Improvement Up-for-grabs
Dominant language
C#
Stars
4.2k
Forks
778
Avg merge
3h 37m
Merged PRs (30d)
21

Description

Tool.Run and related should make stdout and stderr available so that some analysis is possible on failure. Currently it calls [ProcessExitCode](https://github.com/cake-build/cake/blob/develop/src/Cake.Core/Tooling/Tool.cs#L119) which [throws](https://github.com/cake-build/cake/blob/develop/src/Cake.Core/Tooling/Tool.cs#L139) a simple `CakeException`.

Ideally, it would capture stdout and stderr and throw a `CakeProcessException`, or similar, that has additional properties for exit code, stdout and stderr.

Contributor guide

Open the contributing guide

Research direction

Start in src/Cake.Core/Tooling/Tool.cs at ProcessExitCode around lines 119 and 139, and trace how Tool.Run handles failed processes. Define the failure result around the requested CakeProcessException or similar, preserving exit code, stdout, and stderr so callers can inspect them after failure. Done means failed tool execution exposes all three values instead of only a simple CakeException.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
tooling
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.