errors

package
v2.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 2, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package errors provides the central CLI error handler that emits a structured JSON/YAML envelope to stderr when --output=json|yaml, and falls back to the existing plain-text logger for text/TUI mode.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExitFunc

func ExitFunc(code int)

func HandleFatal

func HandleFatal(ctx *context.Context, cmd *cobra.Command, err error)

HandleFatal classifies err, emits a structured envelope to stderr when the active --output mode is json or yaml, and terminates the process.

func HandleUsage

func HandleUsage(ctx *context.Context, cmd *cobra.Command, format string, args ...any)

HandleUsage is a convenience wrapper for invalid flag/argument conditions. It formats the message as a UsageError and routes it through HandleFatal.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL