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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
ProjectRoot describes a project directory Sidecar could not resolve.