multierror

package module
v0.0.0-...-7208a9f Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2024 License: Apache-2.0 Imports: 3 Imported by: 16

README

multierror

Go Report Card Go Reference

This is a simple go package that allows you to combine and present multiple errors as a single error.

[!NOTE]

This repository should be imported as code.cloudfoundry.org/multierror.

Contributing

See the Contributing.md for more information on how to contribute.

Working Group Charter

This repository is maintained by App Runtime Platform under Networking area.

[!IMPORTANT]

Content in this file is managed by the CI task sync-readme and is generated by CI following a convention.

Documentation

Overview

Example Use case for this library

import "github.com/cloudfoundry/multierror"

errors := multierror.MultiError{}

err1 := FirstFuncThatReturnsError() err2 := SecondFuncThatReturnsError()

errors.Add(err1) errors.Add(err2)

//You can also add multierror structs and they will be flattened into one struct errors2 := multierror.MultiError() errors2.Add(err1) errors.Add(errors2)

errors.Error()

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MultiError

type MultiError struct {
	Message string
	Errors  []*MultiError
	// contains filtered or unexported fields
}

func NewMultiError

func NewMultiError(message string) *MultiError

func (*MultiError) Add

func (m *MultiError) Add(e error)

func (*MultiError) Error

func (m *MultiError) Error() string

func (*MultiError) Length

func (m *MultiError) Length() int

Jump to

Keyboard shortcuts

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