cerr

package
v0.0.10 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2021 License: MIT Imports: 7 Imported by: 2

Documentation

Index

Constants

View Source
const (
	MessageKey = "msg"
)

Variables

View Source
var (
	// Unknown error ID. It's returned when the implementation has not returned another AsertoError.
	ErrUnknown = newErr("E10000", codes.Internal, "an unknown error has occurred")
	// Means no tenant id was found in the current context
	ErrNoTenantID = newErr("E10001", codes.InvalidArgument, "no tenant id specified")
	// Means the tenant id is not valid
	ErrInvalidTenantID = newErr("E10002", codes.InvalidArgument, "invalid tenant id")
	// Means the tenant name doesn't conform to our tenant name rules
	ErrInvalidTenantName = newErr("E10003", codes.InvalidArgument, "invalid tenant name")
	// Means the provider ID is invalid
	ErrInvalidProviderID = newErr("E10004", codes.InvalidArgument, "invalid provider id")
	// Means the provider config name doesn't exist
	ErrInvalidProviderConfigName = newErr("E10005", codes.InvalidArgument, "invalid provider config name")
	// The asked-for runtime is not yet available, but will likely be in the future.
	ErrRuntimeLoading = newErr("E10006", codes.Unavailable, "runtime has not yet loaded")
	// Means a connection failed to validate.
	ErrConnectionVerification = newErr("E10007", codes.FailedPrecondition, "connection verification failed")
	// Returned when there's a problem retrieving a connection.
	ErrConnection = newErr("E10008", codes.Unavailable, "connection problem")
	// Returned when there's a problem getting a github access token.
	ErrGithubAccessToken = newErr("E10009", codes.Unavailable, "failed to retrieve github access token")
	// Returned when there's a problem communicating with an SCC provider such as Github.
	ErrSCC = newErr("E10010", codes.Unavailable, "there was an error interacting with the source code provider")
	// Means a provided connection ID was not found in the database.
	ErrConnectionNotFound = newErr("E10011", codes.NotFound, "connection not found")
	// Returned if an account id is not found in the database
	ErrAccountNotFound = newErr("E10012", codes.NotFound, "account not found")
	// Returned if an account id is not valid
	ErrInvalidAccountID = newErr("E10013", codes.InvalidArgument, "invalid account id")
	// Returned if a policy id is not found in the database
	ErrPolicyNotFound = newErr("E10014", codes.NotFound, "policy not found")
	// Returned when there's a problem with one of the system connections
	ErrSystemConnection = newErr("E10015", codes.Internal, "system connection problem")
	// Returned if a policy id is invalid
	ErrInvalidPolicyID = newErr("E10016", codes.InvalidArgument, "invalid policy id")
	// Returned when there's a problem with a connection's secret
	ErrConnectionSecret = newErr("E10017", codes.Unavailable, "connection secret error")
	// Returned when an invite for an email already exists
	ErrInviteExists = newErr("E10018", codes.AlreadyExists, "invite already exists")
	// Returned when an invitation has expired
	ErrInviteExpired = newErr("E10019", codes.AlreadyExists, "invite is expired")
	// Means an existing member of a tenant was invited to join the same tenant
	ErrAlreadyMember = newErr("E10020", codes.AlreadyExists, "already a tenant member")
	// Returned if an account tried to accept or decline the invite of another account
	ErrInviteForAnotherUser = newErr("E10021", codes.PermissionDenied, "invite meant for another user")
	// Returned if an SCC repository has already been referenced in a policy
	ErrRepoAlreadyConnected = newErr("E10022", codes.AlreadyExists, "repo has already been connected to a policy")
	// Returned if there was a problem setting up a Github secret
	ErrGithubSecret = newErr("E10023", codes.Unavailable, "failed to setup repo secret")
	// Returned if there was a problem setting up an Auth0 user
	ErrAuth0UserSetup = newErr("E10024", codes.Unavailable, "failed to setup user")
	// Returned if an invalid email address was used
	ErrInvalidEmail = newErr("E10025", codes.InvalidArgument, "invalid email address")
	// Returned if a string doesn't look like an auth0 ID
	ErrInvalidAuth0ID = newErr("E10026", codes.InvalidArgument, "invalid auth0 ID")
	// Returned when an invitation has been accepted
	ErrInviteAlreadyAccepted = newErr("E10027", codes.AlreadyExists, "invite has already been accepted")
	// Returned when an invitation has been declined
	ErrInviteAlreadyDeclined = newErr("E10028", codes.AlreadyExists, "invite has already been declined")
	// Returned when an invitation has been canceled
	ErrInviteCanceled = newErr("E10029", codes.AlreadyExists, "invite has been canceled")
	// Returned when a provider verification call has failed
	ErrProviderVerification = newErr("E10030", codes.InvalidArgument, "verification failed")
	// Means an account already exists for the specified user
	ErrHasAccount = newErr("E10031", codes.AlreadyExists, "already has an account")
	// Returned when a user is not allowed to perform an operation
	ErrNotAllowed = newErr("E10032", codes.PermissionDenied, "not allowed")
	// Returned when trying to delete the last owner of a tenant
	ErrLastOwner = newErr("E10033", codes.PermissionDenied, "last owner of the tenant")
	// Returned when an operation timed out after multiple retries
	ErrRetryTimeout = newErr("E10034", codes.DeadlineExceeded, "timeout after multiple retries")
	// Returned when a field is marked as an ID, and it's not a string
	ErrInvalidIDType = newErr("E10035", codes.InvalidArgument, "ID fields have to be strings")
	// Returned when an ID is not correct
	ErrInvalidID = newErr("E10036", codes.InvalidArgument, "invalid ID type")
	// Returned when trying to delete an entity that still has dependants
	ErrNotEmpty = newErr("E10037", codes.FailedPrecondition, "entity is not empty")
	// Returned when authentication has failed or is not possible
	ErrAuthenticationFailed = newErr("E10038", codes.FailedPrecondition, "authentication failed")
	// Returned when a given parameter is incorrect (wrong format, value or type)
	ErrInvalidArgument = newErr("E10039", codes.InvalidArgument, "invalid argument")
	// Returned when the caller is trying to update a readonly value
	ErrReadOnly = newErr("E10040", codes.InvalidArgument, "readonly")
	// Returned when the caller tries to create or update a policy with a name that already exists
	ErrDuplicatePolicyName = newErr("E10041", codes.InvalidArgument, "policy name already exists")
	// Returned when the caller tries to create or update a connection with a name that already exists
	ErrDuplicateConnectionName = newErr("E10042", codes.InvalidArgument, "connection name already exists")
)

Functions

This section is empty.

Types

type AsertoError

type AsertoError struct {
	Code       string
	StatusCode codes.Code
	Message    string
	Data       map[string]string
	// contains filtered or unexported fields
}

AsertoError represents a well known error comming from an Aserto service

func (*AsertoError) Bool

func (e *AsertoError) Bool(key string, value bool) *AsertoError

func (*AsertoError) Cause

func (e *AsertoError) Cause() error

func (*AsertoError) Copy

func (e *AsertoError) Copy() *AsertoError

func (*AsertoError) Duration

func (e *AsertoError) Duration(key string, value time.Duration) *AsertoError

func (*AsertoError) Err

func (e *AsertoError) Err(err error) *AsertoError

Associates err with the AsertoError.

func (*AsertoError) Error

func (e *AsertoError) Error() string

func (*AsertoError) Fields

func (e *AsertoError) Fields() map[string]interface{}

func (*AsertoError) FromReader

func (e *AsertoError) FromReader(key string, value io.Reader) *AsertoError

func (*AsertoError) GRPCStatus added in v0.0.6

func (e *AsertoError) GRPCStatus() *status.Status

func (*AsertoError) Int

func (e *AsertoError) Int(key string, value int) *AsertoError

func (*AsertoError) Interface

func (e *AsertoError) Interface(key string, value interface{}) *AsertoError

func (*AsertoError) MarshalZerologObject

func (e *AsertoError) MarshalZerologObject(event *zerolog.Event)

func (*AsertoError) Msg

func (e *AsertoError) Msg(message string) *AsertoError

func (*AsertoError) Msgf

func (e *AsertoError) Msgf(message string, args ...interface{}) *AsertoError

func (*AsertoError) SameAs

func (e *AsertoError) SameAs(err error) bool

SameAs returns true if the provided error is an AsertoError and has the same error code

func (*AsertoError) Str

func (e *AsertoError) Str(key, value string) *AsertoError

func (*AsertoError) Time

func (e *AsertoError) Time(key string, value time.Time) *AsertoError

func (*AsertoError) Unwrap

func (e *AsertoError) Unwrap() error

Jump to

Keyboard shortcuts

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