errors

package
v0.0.0-...-986c4a6 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2020 License: MIT Imports: 2 Imported by: 7

Documentation

Index

Constants

View Source
const (
	TypeInvalidRequest = "invalidRequest"
	TypeInvalidFilter  = "invalidFilter"
	TypeTooMany        = "tooMany"
	TypeUniqueness     = "uniqueness"
	TypeMutability     = "mutability"
	TypeInvalidSyntax  = "invalidSyntax"
	TypeInvalidPath    = "invalidPath"
	TypeNoTarget       = "noTarget"
	TypeInvalidValue   = "invalidValue"
	TypePreCondition   = "preCondition"
	TypeSensitive      = "sensitive"
	TypeNotFound       = "notFound"
	TypeInternal       = "internal"
)

Defined error types. Each error type will have a corresponding constructor.

View Source
const (
	// Schema URN defined for SCIM error messages
	// https://tools.ietf.org/html/rfc7644#section-3.12
	Schema = "urn:ietf:params:scim:api:messages:2.0:Error"
)

Variables

This section is empty.

Functions

func Internal

func Internal(format string, args ...interface{}) error

Returns error to describe that server encountered internal error. This should be the returned error when the user input is not at fault.

func InvalidFilter

func InvalidFilter(format string, args ...interface{}) error

Returns error to describe that the specified filter syntax was invalid, or the specified attribute and filter comparison combination is not supported.

func InvalidPath

func InvalidPath(format string, args ...interface{}) error

Returns error to describe that the "path" attribute was invalid or malformed.

func InvalidRequest

func InvalidRequest(format string, args ...interface{}) error

Returns error to describe that the request is invalid. This is a generic error description, use more specific ones if available.

func InvalidSyntax

func InvalidSyntax(format string, args ...interface{}) error

Returns error to describe that the request body message structure was invalid or did not conform to the request schema.

func InvalidValue

func InvalidValue(format string, args ...interface{}) error

Returns error to describe that a required value was missing, or the value specified was not compatible with the operation or attribute type.

func Mutability

func Mutability(format string, args ...interface{}) error

Returns error to describe that the attempted modification is not compatible with the target attribute's mutability or current state (e.g., modification of an "immutable" attribute with an existing value).

func NoTarget

func NoTarget(format string, args ...interface{}) error

Returns error to describe that the specified "path" did not yield an attribute or attribute value that could be operated on. This occurs when the specified "path" value contains a filter that yields no match.

func NotFound

func NotFound(format string, args ...interface{}) error

Returns error to describe that the request resource is not found in the data store.

func PreConditionFailed

func PreConditionFailed(format string, args ...interface{}) error

Returns error to describe that the specified precondition failed and request cannot proceed.

func Sensitive

func Sensitive(format string, args ...interface{}) error

Returns error to describe that the specified request cannot be completed, due to the passing of sensitive (e.g., personal) information in a request URI.

func TooMany

func TooMany(format string, args ...interface{}) error

Returns error to describe that the specified filter yields many more results than the server is willing to calculate or process.

func Uniqueness

func Uniqueness(format string, args ...interface{}) error

Returns error to describe that one or more of the attribute values are already in use or are reserved.

Types

type Error

type Error struct {
	Status  int
	Type    string
	Message string
}

A SCIM error message. It is recommended to not directly create this structure, but to use constructors defined in factory.

func (Error) Error

func (s Error) Error() string

func (Error) MarshalJSON

func (s Error) MarshalJSON() ([]byte, error)

Marshal SCIM error message to JSON

Jump to

Keyboard shortcuts

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