1
// Copyright 2015 Canonical Ltd.
2
// Licensed under the AGPLv3, see LICENCE file for details.
7
"github.com/juju/errors"
10
type notAvailable struct {
14
// NotAvailable returns an error which satisfies IsNotAvailable.
15
func NotAvailable(thing string) error {
17
errors.NewErr(thing + " is not available"),
21
// IsNotAvailable reports whether err was creates with NotAvailable().
22
func IsNotAvailable(err error) bool {
23
err = errors.Cause(err)
24
_, ok := err.(*notAvailable)