Help us shape the future of Go! Take the 2026 Go Developer Survey

errno

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package errno carries the exit statuses ohmyssh reports to its caller.

The service layer signals failures with these rather than with the CLI framework's own exit errors. That keeps the service free of any dependency on urfave/cli, so its behaviour can be tested by calling it directly instead of driving the command line.

Index

Constants

View Source
const (
	CodeOK    = 0
	CodeError = 1 // general failure: unknown host, nothing saved, session failed
	CodeUsage = 2 // the command line was wrong
)

Process exit statuses.

A remote command's status is deliberately not one of these: it is passed through unchanged, so `ohmyssh exec host -- cmd` reports what cmd reported.

Variables

This section is empty.

Functions

func ExitCode

func ExitCode(err error) int

ExitCode reports the status ohmyssh should exit with for err.

func Message

func Message(err error) string

Message reports what should be printed for err, or "" when err should be reported silently.

Types

type ExitError

type ExitError struct {
	Code    int
	Message string
}

ExitError pairs a message with the exit status that should report it.

An empty message with a non-zero code means "exit silently with this status", which is how a remote command's status is forwarded: the remote command has already said whatever there was to say.

func NewExit

func NewExit(code int, message string) *ExitError

NewExit builds an ExitError.

func (*ExitError) Error

func (e *ExitError) Error() string

Jump to

Keyboard shortcuts

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