errors

package
v0.0.0-...-8f7f911 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2025 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Overview

Package errors contains general purpose errors and error traits for you to build more specific errors in your own packages.

Index

Constants

This section is empty.

Variables

View Source
var CanNotBindQueryParameter = UnMarshalError.NewSubtype("can not bind query parameter.")
View Source
var ClientNotInitialized = MustNeverError.NewSubtype("Client Not Initialized", UnableToCreateTrait)

create, read, write errors

View Source
var CookieNotFoundError = NotFoundError.NewSubtype("CookieNotFoundError")
View Source
var DisabledError = errorx.IllegalState.NewSubtype("Disabled", errorx.Temporary())
View Source
var DuplicateExistsError = errorx.IllegalState.NewSubtype("Duplicate Exists", errorx.Duplicate())
View Source
var DurationExceeded = MustNeverError.NewSubtype("Duration Exceeded", errorx.Timeout())
View Source
var EmptyTrait = errorx.RegisterTrait("Empty")
View Source
var ExpiredError = errorx.TimeoutElapsed.NewSubtype("Expired", errorx.Timeout())
View Source
var HttpClientErrorStatus = errorx.NewType(HttpNamespace, "Client Error", HttpClientTrait)
View Source
var HttpClientTrait = errorx.RegisterTrait("Client Error")
View Source
var HttpNamespace = errorx.NewNamespace("HTTP")
View Source
var HttpRedirectionStatus = errorx.NewType(HttpNamespace, "Redirect Error", HttpRedirectionTrait)

standard http errors

View Source
var HttpRedirectionTrait = errorx.RegisterTrait("Redirection")

http error status traits

View Source
var HttpServerErrorStatus = errorx.NewType(HttpNamespace, "Server Error", HttpServerTrait)
View Source
var HttpServerTrait = errorx.RegisterTrait("Server Error")
View Source
var InvalidData = errorx.NewType(errorx.CommonErrors, "Invalid Data", InvalidTrait)
View Source
var InvalidFormat = errorx.NewType(errorx.CommonErrors, "Invalid Format", InvalidTrait)

constraint/validation errors

View Source
var InvalidJsonPayloadReceived = InvalidData.NewSubtype("invalid json payload received.")
View Source
var InvalidSizeError = MustNeverError.NewSubtype("Invalid Size", InvalidSizeTrait)
View Source
var InvalidSizeTrait = errorx.RegisterTrait("Invalid Size")
View Source
var InvalidState = errorx.NewType(errorx.CommonErrors, "Invalid State", InvalidTrait)
View Source
var InvalidTrait = errorx.RegisterTrait("Invalid")
View Source
var IterationError = MustNeverError.NewSubtype("iteration error", IterationTrait)
View Source
var IterationTrait = errorx.RegisterTrait("iteration failed")
View Source
var LeakTrait = errorx.RegisterTrait("Memory Leak")
View Source
var MarshalError = MustNeverError.NewSubtype("Unable To Marshal", UnableToMarshalTrait)
View Source
var MaxSizeExceededError = MustNeverError.NewSubtype("Max Size Exceeded", InvalidSizeTrait)
View Source
var MinSizeExceededError = MustNeverError.NewSubtype("Min Required Size", InvalidSizeTrait)
View Source
var MultipleErrorTrait = errorx.RegisterTrait("Multiple Errors")
View Source
var MustNamespace = errorx.NewNamespace("Must")
View Source
var MustNeverError = errorx.NewType(MustNamespace, "Must Never Fail", MustNeverErrorTrait)
View Source
var MustNeverErrorTrait = errorx.RegisterTrait("Must Never Error")
View Source
var MustNotBeEmpty = MustNeverError.NewSubtype("Must Not Be Empty", EmptyTrait)
View Source
var MustNotBeNil = MustNeverError.NewSubtype("Must Not Be Nil", NilTrait)
View Source
var MutuallyExclusiveError = MustNeverError.NewSubtype("Mutually Exclusive", MutuallyExclusiveTrait)
View Source
var MutuallyExclusiveTrait = errorx.RegisterTrait("Mutually Exclusive")
View Source
var NilTrait = errorx.RegisterTrait("Nil Reference")
View Source
var NotClosedError = errorx.NewType(errorx.CommonErrors, "Not Closed", LeakTrait, NotClosedTrait)
View Source
var NotClosedTrait = errorx.RegisterTrait("Not Closed")
View Source
var NotCreatedError = MustNeverError.NewSubtype("Not Created", UnableToCreateTrait)
View Source
var NotDeletedError = MustNeverError.NewSubtype("Not Deleted", UnableToDeleteTrait)
View Source
var NotFoundError = errorx.NewType(errorx.CommonErrors, "Not Found", errorx.NotFound())

searching errors

View Source
var NotReadError = MustNeverError.NewSubtype("Not Read", UnableToReadTrait)
View Source
var NotUpdatedError = MustNeverError.NewSubtype("Not Updated", UnableToWriteTrait)
View Source
var NotWrittenError = MustNeverError.NewSubtype("Not Written", UnableToWriteTrait)
View Source
var ParseError = MustNeverError.NewSubtype("Unable to Parse", UnableToParseTrait)

marshalling errors

View Source
var PermanentTrait = errorx.RegisterTrait("Permanent")
View Source
var RegExDoesNotMatch = errorx.IllegalFormat.NewSubtype("does not match regex")
View Source
var StatusBadGateway = HttpServerErrorStatus.NewSubtype("Status Bad Gateway", HttpServerTrait)
View Source
var StatusBadRequest = HttpClientErrorStatus.NewSubtype("Status Bad Request")
View Source
var StatusConflict = HttpClientErrorStatus.NewSubtype("Status Conflict")
View Source
var StatusExpectationFailed = HttpClientErrorStatus.NewSubtype("Status Expectation Failed")
View Source
var StatusFailedDependency = HttpClientErrorStatus.NewSubtype("Status Failed Dependency")
View Source
var StatusForbidden = HttpClientErrorStatus.NewSubtype("Status Forbidden")
View Source
var StatusFound = HttpRedirectionStatus.NewSubtype("Status Found", TemporaryTrait)
View Source
var StatusGatewayTimeout = HttpServerErrorStatus.NewSubtype("Status Gateway Timeout")
View Source
var StatusGone = HttpClientErrorStatus.NewSubtype("Status Gone", PermanentTrait)
View Source
var StatusHTTPVersionNotSupported = HttpServerErrorStatus.NewSubtype("Status HTTP Version Not Supported")
View Source
var StatusInsufficientStorage = HttpServerErrorStatus.NewSubtype("Status Insufficient Storage", InvalidSizeTrait)
View Source
var StatusInternalServerError = HttpServerErrorStatus.NewSubtype("Status Internal Server Error")
View Source
var StatusLengthRequired = HttpClientErrorStatus.NewSubtype("Status Length Required", errorx.NotFound())
View Source
var StatusLocked = HttpClientErrorStatus.NewSubtype("Status Locked")
View Source
var StatusLoopDetected = HttpServerErrorStatus.NewSubtype("Status Loop Detected")
View Source
var StatusMethodNotAllowed = HttpClientErrorStatus.NewSubtype("Status Method Not Allowed")
View Source
var StatusMisdirectedRequest = HttpClientErrorStatus.NewSubtype("Status Misdirected Request")
View Source
var StatusMovedPermanently = HttpRedirectionStatus.NewSubtype("Status Moved Permanently", PermanentTrait)
View Source
var StatusMultipleChoices = HttpRedirectionStatus.NewSubtype("Status Multiple Choices")
View Source
var StatusNetworkAuthenticationRequired = HttpServerErrorStatus.NewSubtype("Status Network Authentication Required")
View Source
var StatusNotAcceptable = HttpClientErrorStatus.NewSubtype("Status Not Acceptable")
View Source
var StatusNotExtended = HttpServerErrorStatus.NewSubtype("Status Not Extended")
View Source
var StatusNotFound = HttpClientErrorStatus.NewSubtype("Status Not Found", errorx.NotFound())
View Source
var StatusNotImplemented = HttpServerErrorStatus.NewSubtype("Status Not Implemented")
View Source
var StatusNotModified = HttpRedirectionStatus.NewSubtype("Status Not Modified")
View Source
var StatusPaymentRequired = HttpClientErrorStatus.NewSubtype("Status Payment Required")
View Source
var StatusPermanentRedirect = HttpRedirectionStatus.NewSubtype("Status Permanent Redirect", PermanentTrait)
View Source
var StatusPreconditionFailed = HttpClientErrorStatus.NewSubtype("Status Precondition Failed")
View Source
var StatusPreconditionRequired = HttpClientErrorStatus.NewSubtype("Status Precondition Required")
View Source
var StatusProxyAuthRequired = HttpClientErrorStatus.NewSubtype("Status Proxy Auth Required")
View Source
var StatusRequestEntityTooLarge = HttpClientErrorStatus.NewSubtype("Status Request Entity Too Large", InvalidSizeTrait)
View Source
var StatusRequestHeaderFieldsTooLarge = HttpClientErrorStatus.NewSubtype("Status Request Header Fields Too Large", InvalidSizeTrait)
View Source
var StatusRequestTimeout = HttpClientErrorStatus.NewSubtype("Status Request Timeout", errorx.Timeout())
View Source
var StatusRequestURITooLong = HttpClientErrorStatus.NewSubtype("Status Request URI Too Long", InvalidSizeTrait)
View Source
var StatusRequestedRangeNotSatisfiable = HttpClientErrorStatus.NewSubtype("Status Requested Range Not Satisfiable")
View Source
var StatusSeeOther = HttpRedirectionStatus.NewSubtype("Status See Other")
View Source
var StatusServiceUnavailable = HttpServerErrorStatus.NewSubtype("Status Service Unavailable")
View Source
var StatusTemporaryRedirect = HttpRedirectionStatus.NewSubtype("Status Temporary Redirect", TemporaryTrait)
View Source
var StatusTooEarly = HttpClientErrorStatus.NewSubtype("Status Too Early")
View Source
var StatusTooManyRequests = HttpClientErrorStatus.NewSubtype("Status Too Many Requests")
View Source
var StatusUnauthorized = HttpClientErrorStatus.NewSubtype("Status Unauthorized")
View Source
var StatusUnavailableForLegalReasons = HttpClientErrorStatus.NewSubtype("Status Unavailable For Legal Reasons")
View Source
var StatusUnprocessableEntity = HttpClientErrorStatus.NewSubtype("Status Unprocessable Entity")
View Source
var StatusUnsupportedMediaType = HttpClientErrorStatus.NewSubtype("Status Unsupported Media Type")
View Source
var StatusUpgradeRequired = HttpClientErrorStatus.NewSubtype("Status Upgrade Required")
View Source
var StatusVariantAlsoNegotiates = HttpServerErrorStatus.NewSubtype("Status Variant Also Negotiates")
View Source
var StructNotInitialized = MustNeverError.NewSubtype("Struct Not Initialized", UnableToCreateTrait)
View Source
var TemporaryTrait = errorx.Temporary()
View Source
var UnMarshalError = MustNeverError.NewSubtype("Unable To UnMarshal", UnableToUnmarshalTrait)
View Source
var UnableToCreateTrait = errorx.RegisterTrait("Unable to Create")
View Source
var UnableToDeleteTrait = errorx.RegisterTrait("Unable to Delete")
View Source
var UnableToMarshalTrait = errorx.RegisterTrait("Unable to Marshal")
View Source
var UnableToParseTrait = errorx.RegisterTrait("Unable to Parse")
View Source
var UnableToReadTrait = errorx.RegisterTrait("Unable to Read")
View Source
var UnableToUnmarshalTrait = errorx.RegisterTrait("Unable to Marshal")
View Source
var UnableToWriteTrait = errorx.RegisterTrait("Unable to Write")
View Source
var Unauthorized = MustNeverError.NewSubtype("Unauthorized")

security (authentication, authorization)

Functions

func FromHttpStatusCode

func FromHttpStatusCode(code string) *errorx.Type

Types

This section is empty.

Jump to

Keyboard shortcuts

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