startupfail

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2026 License: MIT Imports: 7 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package startupfail renders the message Sidecar prints when it cannot reach its first frame. Every pre-render exit in cmd/sidecar goes through here so a user meets one shape of failure: what happened, the specific thing to do about it, and a support path that stays private.

The package never reads a user's settings into its output. It prints paths and error positions — the config file's location and the line a parser stopped on — and never the file's contents beyond that reference. Nothing here uploads anything, and nothing here rewrites configuration to make a launch succeed: a startup that cannot honor the user's config stops and says so rather than quietly running on something else.

Index

Constants

View Source
const (
	// DocsURL and IssuesURL are the two support destinations the failure text
	// offers. Both are things the user chooses to visit; Sidecar contacts
	// neither on its own.
	DocsURL   = "https://sidecar.haplab.com"
	IssuesURL = "https://github.com/marcus/sidecar/issues/new"
)

Variables

This section is empty.

Functions

func Print

func Print(w io.Writer, f Failure)

Print writes a failure to a stream, normally stderr. The caller exits.

func Render

func Render(f Failure) string

Render builds the text for a failure. It is deliberately short: a user who cannot start their tool is looking for one instruction, not a report.

Types

type Failure

type Failure struct {
	// Diagnosis is one plain-language sentence. No Go error text, no jargon.
	Diagnosis string
	// Evidence is the specific detail: a path, an error string, a position in
	// a file. Never a setting's value and never a file's contents.
	Evidence []string
	// NextStep is what the user can do about it, when Sidecar knows. Empty is
	// honest when it does not.
	NextStep string
}

Failure is one pre-render startup failure in the terms a user needs: a plain diagnosis, the evidence worth copying, and the next step when one is known.

func ConfigLoad

func ConfigLoad(path string, err error) Failure

ConfigLoad describes a configuration file Sidecar could not read or parse. It reports where the file is and, for a parse error, which line the parser stopped on — the two facts a user needs to open an editor and fix it — and says plainly that Sidecar will not rewrite the file for them.

func Isolation

func Isolation(err error) Failure

Isolation describes a run that asserted an isolated state tree and did not get one. The check's own error is the diagnosis: it already names the paths that failed the assertion.

func NotATerminal

func NotATerminal() Failure

NotATerminal describes the piped or redirected stdout case. Sidecar's non-interactive surface is its commands, so the next step names them rather than suggesting a settings editor Sidecar does not have.

func ProjectRoot

func ProjectRoot(path string, err error) Failure

ProjectRoot describes a project directory Sidecar could not resolve.

func Terminal

func Terminal(err error) Failure

Terminal describes a terminal that accepted Sidecar and then failed under it.

Jump to

Keyboard shortcuts

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