Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return ExitError type #196

Merged
merged 12 commits into from
May 16, 2024
Merged

Return ExitError type #196

merged 12 commits into from
May 16, 2024

Conversation

lpusok
Copy link
Contributor

@lpusok lpusok commented May 15, 2024

Shove the original command error in the error tree. This allows checking for the specific exit code by code like this:

	var exitError *exec.ExitError
	if errors.As(err, &exitError) {

Added command.FormattedError type to work around issue of not returning the original exec.ExitError type. The Unwrap() method returns the original error, so the above example will now work.

command/command.go Outdated Show resolved Hide resolved
command/command_test.go Outdated Show resolved Hide resolved
godrei
godrei previously approved these changes May 16, 2024
@lpusok lpusok requested a review from godrei May 16, 2024 09:17
@lpusok lpusok merged commit 613f4cb into master May 16, 2024
6 checks passed
@lpusok lpusok deleted the ACI-2813-fix-exitstatus branch May 16, 2024 10:58
@lpusok lpusok restored the ACI-2813-fix-exitstatus branch May 16, 2024 13:27
@lpusok lpusok deleted the ACI-2813-fix-exitstatus branch May 16, 2024 13:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants