cockroach: github.com/cockroachdb/cockroach/pkg/cmd/roachprod/errors Index | Files

package errors

import "github.com/cockroachdb/cockroach/pkg/cmd/roachprod/errors"

Index

Package Files

errors.go

func SelectPriorityError Uses

func SelectPriorityError(errors []error) error

SelectPriorityError selects an error from the list in this priority order:

- the Error with the highest exit code - one of the `error`s - nil

type Cmd Uses

type Cmd struct {
    Err error
}

Cmd wraps errors that result from a command run against the cluster.

func (Cmd) Error Uses

func (e Cmd) Error() string

func (Cmd) ExitCode Uses

func (e Cmd) ExitCode() int

ExitCode gives the process exit code to return for non-cockroach command errors.

func (Cmd) Format Uses

func (e Cmd) Format(s fmt.State, verb rune)

Format passes formatting responsibilities to cockroachdb/errors

func (Cmd) Unwrap Uses

func (e Cmd) Unwrap() error

Unwrap the wrapped the non-cockroach command error.

type Error Uses

type Error interface {
    error

    // The exit code for the error when exiting roachprod.
    ExitCode() int
}

Error is an interface for error types used by the main.wrap() function to output correctly classified log messages and exit codes.

func AsError Uses

func AsError(err error) (Error, bool)

AsError extracts the Error from err's error tree or (nil, false) if none exists.

func ClassifyCmdError Uses

func ClassifyCmdError(err error) Error

ClassifyCmdError classifies an error received while executing a non-cockroach command remotely over an ssh connection to the right Error type.

type SSH Uses

type SSH struct {
    Err error
}

SSH wraps ssh-specific errors from connections to remote hosts.

func (SSH) Error Uses

func (e SSH) Error() string

func (SSH) ExitCode Uses

func (e SSH) ExitCode() int

ExitCode gives the process exit code to return for SSH errors.

func (SSH) Format Uses

func (e SSH) Format(s fmt.State, verb rune)

Format passes formatting responsibilities to cockroachdb/errors

func (SSH) Unwrap Uses

func (e SSH) Unwrap() error

Unwrap the wrapped SSH error.

type Unclassified Uses

type Unclassified struct {
    Err error
}

Unclassified wraps roachprod and unclassified errors.

func (Unclassified) Error Uses

func (e Unclassified) Error() string

func (Unclassified) ExitCode Uses

func (e Unclassified) ExitCode() int

ExitCode gives the process exit code to return for unclassified errors.

func (Unclassified) Format Uses

func (e Unclassified) Format(s fmt.State, verb rune)

Format passes formatting responsibilities to cockroachdb/errors

func (Unclassified) Unwrap Uses

func (e Unclassified) Unwrap() error

Unwrap the wrapped unclassified error.

Package errors imports 3 packages (graph) and is imported by 2 packages. Updated 2020-07-08. Refresh now. Tools for package owners.