Sha256: ba86bfa05d09d8cfa32fde81ab756615c9b1ff01161b35d48541d85664b59b0b

Contents?: true

Size: 841 Bytes

Versions: 215

Compression:

Stored size: 841 Bytes

Contents

package erratum

import "io"

type TransientError struct {
	err error
}

func (e TransientError) Error() string {
	return e.err.Error()
}

type FrobError struct {
	defrobTag string
	inner     error
}

func (e FrobError) Error() string {
	return e.inner.Error()
}

type Resource interface {
	io.Closer

	// Frob does something with the input string.
	// Because this is an incredibly badly designed system if there is an error
	// it panics.
	//
	// The paniced error may be a FrobError in which case Defrob should be called
	// with the defrobTag string.
	Frob(string)

	Defrob(string)
}

// ResourceOpener is a function that creates a resource.
//
// It may return a wrapped error of type TransientError. In this case the resource
// is temporarily unavailable and the caller should retry soon.
type ResourceOpener func() (Resource, error)

Version data entries

215 entries across 215 versions & 1 rubygems

Version Path
trackler-2.2.0.4 tracks/go/exercises/error-handling/common.go
trackler-2.2.0.3 tracks/go/exercises/error-handling/common.go
trackler-2.2.0.2 tracks/go/exercises/error-handling/common.go
trackler-2.2.0.1 tracks/go/exercises/error-handling/common.go
trackler-2.2.0.0 tracks/go/exercises/error-handling/common.go
trackler-2.1.0.55 tracks/go/exercises/error-handling/common.go
trackler-2.1.0.54 tracks/go/exercises/error-handling/common.go
trackler-2.1.0.53 tracks/go/exercises/error-handling/common.go
trackler-2.1.0.52 tracks/go/exercises/error-handling/common.go
trackler-2.1.0.51 tracks/go/exercises/error-handling/common.go
trackler-2.1.0.50 tracks/go/exercises/error-handling/common.go
trackler-2.1.0.49 tracks/go/exercises/error-handling/common.go
trackler-2.1.0.48 tracks/go/exercises/error-handling/common.go
trackler-2.1.0.47 tracks/go/exercises/error-handling/common.go
trackler-2.1.0.46 tracks/go/exercises/error-handling/common.go
trackler-2.1.0.45 tracks/go/exercises/error-handling/common.go
trackler-2.1.0.44 tracks/go/exercises/error-handling/common.go
trackler-2.1.0.43 tracks/go/exercises/error-handling/common.go
trackler-2.1.0.42 tracks/go/exercises/error-handling/common.go
trackler-2.1.0.41 tracks/go/exercises/error-handling/common.go