orbiterr

package
v1.94.0 Latest Latest
Warning

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

Go to latest
Published: May 6, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package orbiterr translates errors returned by the OrbitService into structured `*cmdutils.ExitError` values with Orbit-specific exit codes and human-readable troubleshooting messages.

It is internal to the `glab orbit` command family; the exit codes it defines are part of the public CLI contract and are documented in the `glab orbit` long help.

Index

Constants

View Source
const (
	// ExitOrbitUnavailable is returned when the Knowledge Graph endpoint
	// returns 404. The most common cause is the `knowledge_graph`
	// feature flag being off for the user; a typo in the path produces
	// the same status.
	ExitOrbitUnavailable = 2

	// ExitUnauthenticated is returned when the request is rejected
	// with HTTP 401 — typically an expired or missing token.
	ExitUnauthenticated = 3

	// ExitForbidden is returned when the user is authenticated but
	// not authorized — for `orbit/query`, the most common cause is
	// "no Knowledge Graph enabled namespaces available".
	ExitForbidden = 4

	// ExitRateLimited is returned when the request is rejected with
	// HTTP 429. Inspect the `Retry-After` response header and back off.
	ExitRateLimited = 5
)

Exit codes for `glab orbit` commands.

1 is the generic glab default and is reserved for unexpected errors. 2..5 are Orbit-specific and map directly to HTTP status codes that have a stable user-facing meaning, so scripting agents can branch on them without parsing stderr.

Variables

This section is empty.

Functions

func Translate

func Translate(err error) error

Translate maps an error returned by the OrbitService to a `*cmdutils.ExitError` with a human-readable message and the appropriate Orbit-specific exit code. Non-HTTP errors fall through to a generic exit code 1.

The phrasings mirror the Orbit skill's `references/troubleshooting.md` so users see the same messages whether they invoke the API via `glab orbit` or via the skill's `glab api` recipes.

Types

This section is empty.

Jump to

Keyboard shortcuts

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