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

PDI-2056: Upon Ping CLI encountering an Error, Make Exitcode 1 #22

Merged
merged 1 commit into from
Oct 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions internal/commands/request/request_internal.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@ func runInternalPingOneRequest(uri string) (err error) {
}

if res.StatusCode < 200 || res.StatusCode >= 300 {
// Note we don't os.Exit(1) here because pingcli has executed
// without issue, despite a failed response to the custom request
output.UserError("Failed Custom Request", fields)
} else {
output.Success("Custom request successful", fields)
Expand Down
2 changes: 2 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package main

import (
"fmt"
"os"
"runtime/debug"

"github.com/pingidentity/pingcli/cmd"
Expand Down Expand Up @@ -33,5 +34,6 @@ func main() {
err := rootCmd.Execute()
if err != nil {
output.UserError(fmt.Sprintf("Failed to execute pingcli: %v", err), nil)
os.Exit(1)
}
}