bf9395e022
CI / license-header (push) Has been skipped
CI / e2e-dry-run (push) Has been skipped
CI / fast-gate (push) Failing after 0s
Test PR Label Logic / test-pr-labels (push) Failing after 1s
Skill Format Check / check-format (push) Failing after 2s
CI / security (push) Failing after 5s
CI / unit-test (push) Has been skipped
CI / lint (push) Has been skipped
CI / script-test (push) Has been skipped
CI / deterministic-gate (push) Has been skipped
CI / coverage (push) Has been skipped
CI / results (push) Has been cancelled
CI / deadcode (push) Has been cancelled
CI / e2e-live (push) Has been cancelled
20 lines
798 B
Go
20 lines
798 B
Go
// Copyright (c) 2026 Lark Technologies Pte. Ltd.
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
package output
|
|
|
|
import "fmt"
|
|
|
|
// BareError is the silent-exit signal for commands whose stdout already
|
|
// carries the complete answer and that only need the matching exit code
|
|
// without a stderr envelope. Two cases use it: a predicate writing its yes/no
|
|
// JSON (e.g. `auth check` exiting non-zero on a no-token state), and a command
|
|
// emitting its own structured result envelope under `--json` (e.g. `update`).
|
|
// Deliberately outside the typed-envelope contract.
|
|
type BareError struct{ Code int }
|
|
|
|
func (e *BareError) Error() string { return fmt.Sprintf("bare exit %d", e.Code) }
|
|
|
|
// ErrBare builds the silent-exit signal with the given code.
|
|
func ErrBare(code int) *BareError { return &BareError{Code: code} }
|