errors

package
v0.0.0-...-9bbedf1 Latest Latest
Warning

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

Go to latest
Published: May 15, 2024 License: LGPL-3.0 Imports: 1 Imported by: 0

Documentation

Overview

* This file is part of AMS SDK * Copyright 2021 Canonical Ltd. * * This program is free software: you can redistribute it and/or modify it under * the terms of the Lesser GNU General Public License version 3, as published * by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranties of MERCHANTABILITY, SATISFACTORY * QUALITY, or FITNESS FOR A PARTICULAR PURPOSE. See the Lesser GNU General Public * License for more details. * * You should have received a copy of the Lesser GNU General Public License along * with this program. If not, see <http://www.gnu.org/licenses/>.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrAlreadyRunning is returned when an object is already running when it was started again
	ErrAlreadyRunning = fmt.Errorf("Already running")
)

Functions

func IgnoreErrNotFound

func IgnoreErrNotFound(err error) error

IgnoreErrNotFound returns nil when the provided error is of type ErrNotFound and otherwise the given error

func IsErrInvalidArgument

func IsErrInvalidArgument(err error) bool

IsErrInvalidArgument checks if the given error is of type ErrInvalidArgument

func IsErrNotAllowed

func IsErrNotAllowed(err error) bool

IsErrNotAllowed checks if the given error is of type ErrNotAllowed

func IsErrNotFound

func IsErrNotFound(err error) bool

IsErrNotFound checks if the given error is of type ErrNotFound

Types

type ErrAborted

type ErrAborted struct {
	// contains filtered or unexported fields
}

ErrAborted describes an error when an operation was aborted

func NewErrAborted

func NewErrAborted(what string) ErrAborted

NewErrAborted returns a new ErrAborted struct

func (ErrAborted) Error

func (e ErrAborted) Error() string

Error returns the error string

type ErrAlreadyExists

type ErrAlreadyExists struct {
	// contains filtered or unexported fields
}

ErrAlreadyExists describes an error when a resource already exists

func NewErrAlreadyExists

func NewErrAlreadyExists(what string) ErrAlreadyExists

NewErrAlreadyExists returns a new ErrAlreadyExists struct

func (ErrAlreadyExists) Error

func (e ErrAlreadyExists) Error() string

Error returns the error string

type ErrDontMatch

type ErrDontMatch struct {
	// contains filtered or unexported fields
}

ErrDontMatch error struct for a parameter whose value does not match the expected

func NewErrDontMatch

func NewErrDontMatch(what, got, expected string) ErrDontMatch

NewErrDontMatch returns a new ErrDontMatch struct

func (ErrDontMatch) Error

func (e ErrDontMatch) Error() string

Error returns the error string

type ErrFailed

type ErrFailed struct {
	// contains filtered or unexported fields
}

ErrFailed describes an error when an operation has failed

func NewErrFailed

func NewErrFailed(what string) ErrFailed

NewErrFailed returns a new ErrFailed struct

func (ErrFailed) Error

func (e ErrFailed) Error() string

Error returns the error string

type ErrInProgress

type ErrInProgress struct {
	// contains filtered or unexported fields
}

ErrInProgress describes an error when an operation is already in progress

func NewErrInProgress

func NewErrInProgress(what string) ErrInProgress

NewErrInProgress returns a new ErrInProgress struct

func (ErrInProgress) Error

func (e ErrInProgress) Error() string

Error returns the error string

type ErrInvalidArgument

type ErrInvalidArgument struct {
	// contains filtered or unexported fields
}

ErrInvalidArgument describes the error when an invalid argument was given

func NewInvalidArgument

func NewInvalidArgument(what string) ErrInvalidArgument

NewInvalidArgument returns a new ErrInvalidArgument struct

func (ErrInvalidArgument) Error

func (e ErrInvalidArgument) Error() string

Error returns the error string

type ErrInvalidFormat

type ErrInvalidFormat struct {
	// contains filtered or unexported fields
}

ErrInvalidFormat describes the error when an invalid format for an argument was given

func NewErrInvalidFormat

func NewErrInvalidFormat(what string) ErrInvalidFormat

NewErrInvalidFormat returns a new ErrInvalidFormat struct

func (ErrInvalidFormat) Error

func (e ErrInvalidFormat) Error() string

Error returns the error string

type ErrInvalidLength

type ErrInvalidLength struct {
	// contains filtered or unexported fields
}

ErrInvalidLength describes the error when an argument has an invalid length

func NewErrInvalidLength

func NewErrInvalidLength(what string) ErrInvalidLength

NewErrInvalidLength returns a new ErrInvalidLength struct

func (ErrInvalidLength) Error

func (e ErrInvalidLength) Error() string

Error returns the error string

type ErrMalformed

type ErrMalformed struct {
	// contains filtered or unexported fields
}

ErrMalformed describes the error when a malformed content was given

func NewErrMalformed

func NewErrMalformed(what string) ErrMalformed

NewErrMalformed returns a new ErrMalformed struct

func (ErrMalformed) Error

func (e ErrMalformed) Error() string

Error returns the error string

type ErrNotAllowed

type ErrNotAllowed struct {
	// contains filtered or unexported fields
}

ErrNotAllowed error struct when an operation is not allowed

func NewErrNotAllowed

func NewErrNotAllowed(what string) ErrNotAllowed

NewErrNotAllowed returns a new ErrNotAllowed struct

func (ErrNotAllowed) Error

func (e ErrNotAllowed) Error() string

Error returns the error string

type ErrNotChanged

type ErrNotChanged struct {
	// contains filtered or unexported fields
}

ErrNotChanged describes an error when a value has changed

func NewErrNotChanged

func NewErrNotChanged(what string) ErrNotChanged

NewErrNotChanged returns a new ErrNotChanged struct

func (ErrNotChanged) Error

func (e ErrNotChanged) Error() string

Error returns the error string

type ErrNotExecutable

type ErrNotExecutable struct {
	// contains filtered or unexported fields
}

ErrNotExecutable represents a non executable file permission error structure

func NewErrNotExecutable

func NewErrNotExecutable(what string) ErrNotExecutable

NewErrNotExecutable returns a new ErrNotExecutable struct

func (ErrNotExecutable) Error

func (e ErrNotExecutable) Error() string

Error returns the error string

type ErrNotFound

type ErrNotFound struct {
	// contains filtered or unexported fields
}

ErrNotFound error struct for a not existing resource

func NewErrNotFound

func NewErrNotFound(what string) ErrNotFound

NewErrNotFound returns a new ErrNotFound struct

func (ErrNotFound) Error

func (e ErrNotFound) Error() string

Error returns the error string

type ErrNotSupported

type ErrNotSupported struct {
	// contains filtered or unexported fields
}

ErrNotSupported error struct for a not supported functionality

func NewErrNotSupported

func NewErrNotSupported(what string) ErrNotSupported

NewErrNotSupported returns a new ErrNotSupported struct

func (ErrNotSupported) Error

func (e ErrNotSupported) Error() string

Error returns the error string

type ErrRequired

type ErrRequired struct {
	// contains filtered or unexported fields
}

ErrRequired error struct for a required parameter

func NewErrRequired

func NewErrRequired(what string) ErrRequired

NewErrRequired returns a new ErrRequiredstruct

func (ErrRequired) Error

func (e ErrRequired) Error() string

Error returns the error string

type ErrTimeout

type ErrTimeout struct {
	// contains filtered or unexported fields
}

ErrTimeout describes an error when an operation timed out

func NewErrTimeout

func NewErrTimeout(what string) ErrTimeout

NewErrTimeout returns a new ErrAborted struct

func (ErrTimeout) Error

func (e ErrTimeout) Error() string

Error returns the error string

type ErrUnknown

type ErrUnknown struct {
	// contains filtered or unexported fields
}

ErrUnknown describes the error which a parameter was unknown

func NewErrUnknown

func NewErrUnknown(what string) ErrUnknown

NewErrUnknown returns a new ErrUnknown struct

func (ErrUnknown) Error

func (e ErrUnknown) Error() string

ErrUnknown returns the error string

Jump to

Keyboard shortcuts

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