Skip to content

fix(errors): honor caller exit code in Fatal#408

Open
Rahulatram321 wants to merge 2 commits into
microcks:masterfrom
Rahulatram321:fix/errors-fatal-exitcode
Open

fix(errors): honor caller exit code in Fatal#408
Rahulatram321 wants to merge 2 commits into
microcks:masterfrom
Rahulatram321:fix/errors-fatal-exitcode

Conversation

@Rahulatram321
Copy link
Copy Markdown

Description

This PR fixes exit-code handling in pkg/errors.Fatal so command-level callers can reliably control process exit status.

Problem

Fatal(exitcode, args...) currently uses log.Fatal(args...), which already exits with code 1.
That means the subsequent os.Exit(exitcode) is effectively unreachable for non-1 exit semantics, and caller-provided exit codes are not honored.

Changes

In pkg/errors/error.go:

  • Replaced log.Fatal(args...) with log.Println(args...)
  • Kept explicit os.Exit(exitcode)

Result

  • Error is still logged.
  • Process exits using the caller-provided code, restoring expected CLI behavior for scripts/CI that rely on specific status codes.

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.

1 participant