Documentation
¶
Overview ¶
Package xerror provides a unified error type for the application.
Sentinel errors are constructed via template functions that pair a Kind (category) with an Entity (the affected domain object). The API error code and human-readable message are derived automatically from the Kind and Entity, following a predictable {ENTITY}_{KIND_SUFFIX} pattern.
Entity-based templates:
xerror.NotFound(xerror.User) // USER_NOT_FOUND, "user not found" xerror.AlreadyExists(xerror.UserEmail) // USER_EMAIL_ALREADY_EXISTS xerror.AlreadyExists(xerror.User) // USER_ALREADY_EXISTS
Standalone templates for cross-cutting errors:
xerror.ValidationFailed() // VALIDATION_FAILED, "validation failed" xerror.InvalidCredentials() // INVALID_CREDENTIALS, "invalid credentials"
Index ¶
- Variables
- func As(err error, target any) bool
- func Is(err, target error) bool
- func Join(errs ...error) error
- func KindStrings() []string
- func PublicDetail(err error) string
- func Unwrap(err error) error
- func Wrapf(format string, args ...any) error
- type Entity
- type Error
- func AlreadyExists(entity Entity) *Error
- func AlreadyVerified() *Error
- func BuilderStateInvalid() *Error
- func CannotDeleteDefault(entity Entity) *Error
- func CannotDemoteOwner() *Error
- func CannotRemoveOwner() *Error
- func CannotUpdateDefault(entity Entity) *Error
- func ConnectionFailed(entity Entity) *Error
- func DataSourceBindingUnavailable() *Error
- func DataSourceReadOnly() *Error
- func DataSourceRefIncompatible() *Error
- func DataSourceSchemaIntrospectionUnsupported() *Error
- func DestinationConstraintViolation() *Error
- func EmailNotVerified() *Error
- func ExecutionConcurrencyLimitExceeded() *Error
- func ExecutionFailed() *Error
- func ExecutionRedirectLimitExceeded() *Error
- func ExecutionRequestSizeExceeded() *Error
- func ExecutionResponseSizeExceeded() *Error
- func ExecutionRowLimitExceeded() *Error
- func ExecutionUnavailable() *Error
- func Forbidden(entity Entity) *Error
- func HTTPAcknowledgementRejected() *Error
- func HTTPAcknowledgementUncertain() *Error
- func InvalidCredentials() *Error
- func InvalidFieldPath() *Error
- func InvalidInput(entity Entity) *Error
- func InvalidOpenAPI() *Error
- func InvalidRequired(entity Entity) *Error
- func InvalidSchemaURL() *Error
- func InvalidSlugFormat() *Error
- func InvalidToken() *Error
- func InvalidTransformAvgArgumentRequired() *Error
- func InvalidTransformCastTargetRequired() *Error
- func InvalidTransformDivisionByZero() *Error
- func InvalidTransformLimitNegative() *Error
- func InvalidTransformRuntimeAggregateColumnReferenceRequired() *Error
- func InvalidTransformSumArgumentRequired() *Error
- func New(kind Kind, code, message string) *Error
- func NoPipelineSpecsFound() *Error
- func NotFound(entity Entity) *Error
- func OrphanStep() *Error
- func ParameterValidationFailed() *Error
- func PipelineContractMismatch() *Error
- func PipelineMissingField() *Error
- func QueryOutputContractSchemaMismatch() *Error
- func RefStepNoResult() *Error
- func RefUnknownField() *Error
- func RefUnknownStep() *Error
- func ReplayRunNotFound() *Error
- func ReplayStepNotFound() *Error
- func ReplayUnsafe() *Error
- func ReplayUnsupportedMode() *Error
- func SchemaFetchFailed() *Error
- func SinkInputContractViolation() *Error
- func SinkSourceResultNotFound() *Error
- func SinkUpstreamRequired() *Error
- func SourceQueryInvalid() *Error
- func SourceSchemaReferenceInvalid() *Error
- func StepResultExecutionRequired() *Error
- func Timeout(entity Entity) *Error
- func TransformBindingMissing() *Error
- func TransformBindingNodeUnsupported() *Error
- func TransformBindingSourceAmbiguous() *Error
- func TransformBindingSourceNotFound() *Error
- func TransformContractInvalid() *Error
- func TransformContractMissingField() *Error
- func TransformContractTypeMismatch() *Error
- func TransformInputContractViolation() *Error
- func TransformOutputContractViolation() *Error
- func TransformRuntimeAggregateExpressionUnsupported() *Error
- func TransformRuntimeHeadlessCSVNamedAccessUnsupported() *Error
- func TransformRuntimeOutputKindUnsupported() *Error
- func TransformRuntimeProjectionExpressionUnsupported() *Error
- func TransformRuntimeProjectionFieldNotFound() *Error
- func TransformRuntimeWhereExpressionUnsupported() *Error
- func TransformSQLFeatureNotAllowed() *Error
- func TransformSQLMultiStatement() *Error
- func TransformSQLNotSelect() *Error
- func TransformSQLRequired() *Error
- func TransformTypeValidationInput() *Error
- func TransformUpstreamRequired() *Error
- func Unavailable(entity Entity) *Error
- func Unexpected() *Error
- func UnexpectedRequired(entity Entity) *Error
- func UnexpectedTransformSpecRequired() *Error
- func UnexpectedUpstreamResultRequired() *Error
- func Unsupported(entity Entity) *Error
- func UnsupportedHTTPContentType() *Error
- func UnsupportedHTTPResponseFormat() *Error
- func UnsupportedPipelineFormat() *Error
- func UnsupportedTransformRuntimeInput() *Error
- func UnsupportedURIScheme() *Error
- func ValidationFailed() *Error
- func (e *Error) Code() string
- func (e *Error) Detail(msg string) *Error
- func (e *Error) Detailf(format string, args ...any) *Error
- func (e *Error) Error() string
- func (e *Error) Is(target error) bool
- func (e *Error) Kind() Kind
- func (e *Error) Message() string
- func (e *Error) PublicDetail() string
- func (e *Error) Unwrap() error
- func (e *Error) With(err error) *Error
- func (e *Error) WithPublicDetail(detail string) *Error
- type Kind
Constants ¶
This section is empty.
Variables ¶
var ( User = Entity{/* contains filtered or unexported fields */} Organization = Entity{/* contains filtered or unexported fields */} OrganizationSlug = Entity{/* contains filtered or unexported fields */} Member = Entity{/* contains filtered or unexported fields */} MemberInvitation = Entity{/* contains filtered or unexported fields */} Role = Entity{/* contains filtered or unexported fields */} APIKey = Entity{/* contains filtered or unexported fields */} PersonalAccessToken = Entity{/* contains filtered or unexported fields */} DataSource = Entity{/* contains filtered or unexported fields */} DataSourceRef = Entity{/* contains filtered or unexported fields */} DataSourceBinding = Entity{/* contains filtered or unexported fields */} DataSourceService = Entity{/* contains filtered or unexported fields */} Project = Entity{/* contains filtered or unexported fields */} Environment = Entity{/* contains filtered or unexported fields */} ProjectEnvironment = Entity{ // contains filtered or unexported fields } RuntimeVariable = Entity{/* contains filtered or unexported fields */} EnvironmentSecret = Entity{ // contains filtered or unexported fields } Event = Entity{/* contains filtered or unexported fields */} Notification = Entity{/* contains filtered or unexported fields */} AlertPolicy = Entity{ // contains filtered or unexported fields } AlertDestination = Entity{ // contains filtered or unexported fields } Query = Entity{/* contains filtered or unexported fields */} QueryExecutor = Entity{/* contains filtered or unexported fields */} Permission = Entity{/* contains filtered or unexported fields */} SchemaMetadata = Entity{/* contains filtered or unexported fields */} SchemaResult = Entity{/* contains filtered or unexported fields */} JSON = Entity{/* contains filtered or unexported fields */} UserMember = Entity{/* contains filtered or unexported fields */} Slug = Entity{/* contains filtered or unexported fields */} PasswordHash = Entity{/* contains filtered or unexported fields */} Cursor = Entity{/* contains filtered or unexported fields */} ReplayRunSlug = Entity{/* contains filtered or unexported fields */} RunPersister = Entity{/* contains filtered or unexported fields */} RunStore = Entity{/* contains filtered or unexported fields */} SinkRuntime = Entity{/* contains filtered or unexported fields */} )
Domain entities.
var ( Pipeline = Entity{/* contains filtered or unexported fields */} PipelineDeployment = Entity{/* contains filtered or unexported fields */} PipelineDraft = Entity{/* contains filtered or unexported fields */} PipelineReference = Entity{/* contains filtered or unexported fields */} PipelineVersion = Entity{/* contains filtered or unexported fields */} PipelineRun = Entity{/* contains filtered or unexported fields */} PipelineSinkEffect = Entity{/* contains filtered or unexported fields */} PipelineCheckpoint = Entity{/* contains filtered or unexported fields */} PipelineTrigger = Entity{/* contains filtered or unexported fields */} PipelineValidationResult = Entity{ // contains filtered or unexported fields } DriftImpactReport = Entity{/* contains filtered or unexported fields */} )
Pipeline domain entities.
var (
RepoFile = Entity{/* contains filtered or unexported fields */}
)
Repository domain entities.
var (
UserEmail = Entity{/* contains filtered or unexported fields */}
)
Fine-grained entities for uniqueness-conflict errors.
Functions ¶
func KindStrings ¶
func KindStrings() []string
KindStrings returns a slice of all String values of the enum
func PublicDetail ¶
PublicDetail finds the first explicit sanitized client-facing detail in an error chain.
Types ¶
type Entity ¶
type Entity struct {
// contains filtered or unexported fields
}
Entity identifies the domain object an error relates to.
type Error ¶
type Error struct {
// contains filtered or unexported fields
}
Error is a structured error type that carries a kind, a stable API code, a human-readable message, and an optional wrapped cause.
func AlreadyExists ¶
AlreadyExists creates a KindAlreadyExists error for the given entity. Use fine-grained entities for conflict specificity (e.g. UserEmail).
func AlreadyVerified ¶
func AlreadyVerified() *Error
AlreadyVerified creates a KindInvalidInput error for re-verification attempts.
func BuilderStateInvalid ¶
func BuilderStateInvalid() *Error
BuilderStateInvalid creates a KindInvalidInput error for invalid builder state payloads.
func CannotDeleteDefault ¶
CannotDeleteDefault creates a KindInvalidInput error when attempting to delete a default/system entity (e.g. a default role).
func CannotDemoteOwner ¶
func CannotDemoteOwner() *Error
CannotDemoteOwner creates a KindInvalidInput error when attempting to change the organization owner's role.
func CannotRemoveOwner ¶
func CannotRemoveOwner() *Error
CannotRemoveOwner creates a KindInvalidInput error when attempting to remove the organization owner.
func CannotUpdateDefault ¶
CannotUpdateDefault creates a KindInvalidInput error when attempting to update a default/system entity (e.g. a default role).
func ConnectionFailed ¶
ConnectionFailed creates a KindConnectionFailed error for the given entity.
func DataSourceBindingUnavailable ¶
func DataSourceBindingUnavailable() *Error
DataSourceBindingUnavailable creates a KindUnavailable error when a binding points at a concrete data source that cannot currently be used.
func DataSourceReadOnly ¶
func DataSourceReadOnly() *Error
DataSourceReadOnly creates a KindForbidden error when a read-only data source would mutate a remote system.
func DataSourceRefIncompatible ¶
func DataSourceRefIncompatible() *Error
DataSourceRefIncompatible creates a KindInvalidInput error for a logical ref that cannot be satisfied by its connector type or concrete binding.
func DataSourceSchemaIntrospectionUnsupported ¶
func DataSourceSchemaIntrospectionUnsupported() *Error
DataSourceSchemaIntrospectionUnsupported creates a KindUnsupported error when a datasource connector does not support schema introspection.
func DestinationConstraintViolation ¶
func DestinationConstraintViolation() *Error
DestinationConstraintViolation reports a rejected write without provider or row details.
func EmailNotVerified ¶
func EmailNotVerified() *Error
EmailNotVerified creates a KindUnauthorized error for unverified accounts.
func ExecutionConcurrencyLimitExceeded ¶
func ExecutionConcurrencyLimitExceeded() *Error
ExecutionConcurrencyLimitExceeded creates a KindUnavailable error when a scoped runtime concurrency limit is already saturated.
func ExecutionFailed ¶
func ExecutionFailed() *Error
ExecutionFailed creates a KindUnavailable error for pipeline execution failures.
func ExecutionRedirectLimitExceeded ¶
func ExecutionRedirectLimitExceeded() *Error
ExecutionRedirectLimitExceeded creates a KindInvalidInput error when an HTTP connector follows too many redirects.
func ExecutionRequestSizeExceeded ¶
func ExecutionRequestSizeExceeded() *Error
ExecutionRequestSizeExceeded creates a KindInvalidInput error when an outbound execution request body is too large.
func ExecutionResponseSizeExceeded ¶
func ExecutionResponseSizeExceeded() *Error
ExecutionResponseSizeExceeded creates a KindInvalidInput error when execution response data is too large.
func ExecutionRowLimitExceeded ¶
func ExecutionRowLimitExceeded() *Error
ExecutionRowLimitExceeded creates a KindInvalidInput error when execution returns too many rows.
func ExecutionUnavailable ¶
func ExecutionUnavailable() *Error
ExecutionUnavailable creates a KindInternal error when pipeline execution is not configured.
func HTTPAcknowledgementRejected ¶
func HTTPAcknowledgementRejected() *Error
HTTPAcknowledgementRejected reports an explicit negative response without asserting rollback.
func HTTPAcknowledgementUncertain ¶
func HTTPAcknowledgementUncertain() *Error
HTTPAcknowledgementUncertain prevents missing delivery evidence from becoming success.
func InvalidCredentials ¶
func InvalidCredentials() *Error
InvalidCredentials creates a KindUnauthorized error for bad login attempts.
func InvalidFieldPath ¶
func InvalidFieldPath() *Error
InvalidFieldPath creates a KindInvalidInput error for invalid pipeline field paths.
func InvalidInput ¶
InvalidInput creates a KindInvalidInput error for the given entity.
func InvalidOpenAPI ¶
func InvalidOpenAPI() *Error
InvalidOpenAPI creates a KindInvalidInput error for invalid OpenAPI specs.
func InvalidRequired ¶
InvalidRequired creates a KindInvalidInput error for a missing required value.
func InvalidSchemaURL ¶
func InvalidSchemaURL() *Error
InvalidSchemaURL creates a KindInvalidInput error for invalid schema URLs.
func InvalidSlugFormat ¶
func InvalidSlugFormat() *Error
InvalidSlugFormat creates a KindInvalidInput error for invalid slug syntax.
func InvalidToken ¶
func InvalidToken() *Error
InvalidToken creates a KindInvalidInput error for token validation failures.
func InvalidTransformAvgArgumentRequired ¶
func InvalidTransformAvgArgumentRequired() *Error
InvalidTransformAvgArgumentRequired creates a KindInvalidInput error when AVG is missing an argument.
func InvalidTransformCastTargetRequired ¶
func InvalidTransformCastTargetRequired() *Error
InvalidTransformCastTargetRequired creates a KindInvalidInput error when CAST target type is missing.
func InvalidTransformDivisionByZero ¶
func InvalidTransformDivisionByZero() *Error
InvalidTransformDivisionByZero creates a KindInvalidInput error for division by zero in runtime transforms.
func InvalidTransformLimitNegative ¶
func InvalidTransformLimitNegative() *Error
InvalidTransformLimitNegative creates a KindInvalidInput error when LIMIT offset or count is negative.
func InvalidTransformRuntimeAggregateColumnReferenceRequired ¶
func InvalidTransformRuntimeAggregateColumnReferenceRequired() *Error
InvalidTransformRuntimeAggregateColumnReferenceRequired creates a KindInvalidInput error when an aggregate expression is missing a column reference.
func InvalidTransformSumArgumentRequired ¶
func InvalidTransformSumArgumentRequired() *Error
InvalidTransformSumArgumentRequired creates a KindInvalidInput error when SUM is missing an argument.
func New ¶
New creates an Error with an explicit kind, code, and message. Use this in domain packages to define local sentinels without adding them to templates.go.
func NoPipelineSpecsFound ¶
func NoPipelineSpecsFound() *Error
NoPipelineSpecsFound creates a KindNotFound error when a repository scan finds no specs.
func OrphanStep ¶
func OrphanStep() *Error
OrphanStep creates a KindInvalidInput error for disconnected pipeline steps.
func ParameterValidationFailed ¶
func ParameterValidationFailed() *Error
ParameterValidationFailed creates a KindInvalidInput error for query parameter validation failures.
func PipelineContractMismatch ¶
func PipelineContractMismatch() *Error
PipelineContractMismatch creates a KindInvalidInput error for incompatible binding contracts.
func PipelineMissingField ¶
func PipelineMissingField() *Error
PipelineMissingField creates a KindInvalidInput error for missing required pipeline fields.
func QueryOutputContractSchemaMismatch ¶
func QueryOutputContractSchemaMismatch() *Error
QueryOutputContractSchemaMismatch creates a KindInvalidInput error for mismatched cached query schemas.
func RefStepNoResult ¶
func RefStepNoResult() *Error
RefStepNoResult creates a KindInvalidInput error for references to steps with no result.
func RefUnknownField ¶
func RefUnknownField() *Error
RefUnknownField creates a KindInvalidInput error for references to unknown fields.
func RefUnknownStep ¶
func RefUnknownStep() *Error
RefUnknownStep creates a KindInvalidInput error for references to unknown steps.
func ReplayRunNotFound ¶
func ReplayRunNotFound() *Error
ReplayRunNotFound creates a KindNotFound error for missing replay source runs.
func ReplayStepNotFound ¶
func ReplayStepNotFound() *Error
ReplayStepNotFound creates a KindNotFound error for missing replay checkpoint steps.
func ReplayUnsafe ¶
func ReplayUnsafe() *Error
ReplayUnsafe creates a KindInvalidInput error when automatic replay would repeat a non-replay-safe side effect.
func ReplayUnsupportedMode ¶
func ReplayUnsupportedMode() *Error
ReplayUnsupportedMode creates a KindUnsupported error for unsupported replay modes.
func SchemaFetchFailed ¶
func SchemaFetchFailed() *Error
SchemaFetchFailed creates a KindUnavailable error when a schema cannot be retrieved.
func SinkInputContractViolation ¶
func SinkInputContractViolation() *Error
SinkInputContractViolation creates a KindInvalidInput error when an upstream result does not satisfy the sink step input contract.
func SinkSourceResultNotFound ¶
func SinkSourceResultNotFound() *Error
SinkSourceResultNotFound creates a KindNotFound error for missing sink source results.
func SinkUpstreamRequired ¶
func SinkUpstreamRequired() *Error
SinkUpstreamRequired creates a KindInvalidInput error when a sink has no upstream result.
func SourceQueryInvalid ¶
func SourceQueryInvalid() *Error
SourceQueryInvalid reports a provider-rejected query without provider details.
func SourceSchemaReferenceInvalid ¶
func SourceSchemaReferenceInvalid() *Error
SourceSchemaReferenceInvalid reports an unresolved query schema reference.
func StepResultExecutionRequired ¶
func StepResultExecutionRequired() *Error
StepResultExecutionRequired creates a KindInternal error for missing step result execution data.
func TransformBindingMissing ¶
func TransformBindingMissing() *Error
TransformBindingMissing creates a KindInvalidInput error for missing transform input bindings.
func TransformBindingNodeUnsupported ¶
func TransformBindingNodeUnsupported() *Error
TransformBindingNodeUnsupported creates a KindUnsupported error for unsupported transform binding node kinds.
func TransformBindingSourceAmbiguous ¶
func TransformBindingSourceAmbiguous() *Error
TransformBindingSourceAmbiguous creates a KindInvalidInput error for ambiguous transform binding sources.
func TransformBindingSourceNotFound ¶
func TransformBindingSourceNotFound() *Error
TransformBindingSourceNotFound creates a KindInvalidInput error for unresolved transform binding sources.
func TransformContractInvalid ¶
func TransformContractInvalid() *Error
TransformContractInvalid creates a KindInvalidInput error for invalid transform output contracts.
func TransformContractMissingField ¶
func TransformContractMissingField() *Error
TransformContractMissingField creates a KindInvalidInput error for missing transform contract fields.
func TransformContractTypeMismatch ¶
func TransformContractTypeMismatch() *Error
TransformContractTypeMismatch creates a KindInvalidInput error for transform output type mismatches.
func TransformInputContractViolation ¶
func TransformInputContractViolation() *Error
TransformInputContractViolation creates a KindInvalidInput error when an upstream result does not satisfy the transform input contract.
func TransformOutputContractViolation ¶
func TransformOutputContractViolation() *Error
TransformOutputContractViolation creates a KindInvalidInput error for runtime output contract violations.
func TransformRuntimeAggregateExpressionUnsupported ¶
func TransformRuntimeAggregateExpressionUnsupported() *Error
TransformRuntimeAggregateExpressionUnsupported creates a KindUnsupported error for unsupported aggregate expressions.
func TransformRuntimeHeadlessCSVNamedAccessUnsupported ¶
func TransformRuntimeHeadlessCSVNamedAccessUnsupported() *Error
TransformRuntimeHeadlessCSVNamedAccessUnsupported creates a KindUnsupported error when named field access is used for headless CSV values.
func TransformRuntimeOutputKindUnsupported ¶
func TransformRuntimeOutputKindUnsupported() *Error
TransformRuntimeOutputKindUnsupported creates a KindUnsupported error for unsupported transform output kinds.
func TransformRuntimeProjectionExpressionUnsupported ¶
func TransformRuntimeProjectionExpressionUnsupported() *Error
TransformRuntimeProjectionExpressionUnsupported creates a KindUnsupported error for unsupported transform runtime projection expressions.
func TransformRuntimeProjectionFieldNotFound ¶
func TransformRuntimeProjectionFieldNotFound() *Error
TransformRuntimeProjectionFieldNotFound creates a KindNotFound error for missing projection fields.
func TransformRuntimeWhereExpressionUnsupported ¶
func TransformRuntimeWhereExpressionUnsupported() *Error
TransformRuntimeWhereExpressionUnsupported creates a KindUnsupported error for unsupported runtime WHERE expressions.
func TransformSQLFeatureNotAllowed ¶
func TransformSQLFeatureNotAllowed() *Error
TransformSQLFeatureNotAllowed creates a KindUnsupported error for disallowed transform SQL features.
func TransformSQLMultiStatement ¶
func TransformSQLMultiStatement() *Error
TransformSQLMultiStatement creates a KindInvalidInput error for multiple transform statements.
func TransformSQLNotSelect ¶
func TransformSQLNotSelect() *Error
TransformSQLNotSelect creates a KindInvalidInput error for non-SELECT transform SQL.
func TransformSQLRequired ¶
func TransformSQLRequired() *Error
TransformSQLRequired creates a KindInvalidInput error for missing transform SQL.
func TransformTypeValidationInput ¶
func TransformTypeValidationInput() *Error
TransformTypeValidationInput creates a KindInvalidInput error when type validation lacks datasource context.
func TransformUpstreamRequired ¶
func TransformUpstreamRequired() *Error
TransformUpstreamRequired creates a KindInvalidInput error when a transform has no upstream result.
func Unavailable ¶
Unavailable creates a KindUnavailable error for the given entity.
func UnexpectedRequired ¶
UnexpectedRequired creates a KindInternal error for a missing internal dependency.
func UnexpectedTransformSpecRequired ¶
func UnexpectedTransformSpecRequired() *Error
UnexpectedTransformSpecRequired creates a KindInternal error for missing transform specs.
func UnexpectedUpstreamResultRequired ¶
func UnexpectedUpstreamResultRequired() *Error
UnexpectedUpstreamResultRequired creates a KindInternal error for missing upstream step results.
func Unsupported ¶
Unsupported creates a KindUnsupported error for the given entity.
func UnsupportedHTTPContentType ¶
func UnsupportedHTTPContentType() *Error
UnsupportedHTTPContentType creates a KindUnsupported error when the HTTP response Content-Type is not a format the transform layer can consume. Callers should attach the specific content type via .Detailf(...).
func UnsupportedHTTPResponseFormat ¶
func UnsupportedHTTPResponseFormat() *Error
UnsupportedHTTPResponseFormat creates a KindUnsupported error when an HTTP response body cannot be interpreted as a tabular input for the transform layer.
func UnsupportedPipelineFormat ¶
func UnsupportedPipelineFormat() *Error
UnsupportedPipelineFormat creates a KindUnsupported error for unsupported pipeline file formats.
func UnsupportedTransformRuntimeInput ¶
func UnsupportedTransformRuntimeInput() *Error
UnsupportedTransformRuntimeInput creates a KindUnsupported error for unsupported runtime input sources.
func UnsupportedURIScheme ¶
func UnsupportedURIScheme() *Error
UnsupportedURIScheme creates a KindUnsupported error for unsupported datasource URI schemes.
func ValidationFailed ¶
func ValidationFailed() *Error
ValidationFailed creates a generic KindInvalidInput error.
func (*Error) Detail ¶
Detail returns a copy of the error with a plain-string detail message attached. If the error already has a cause, the new message is prepended and the existing cause is preserved in the chain via wrapping.
func (*Error) Detailf ¶
Detailf returns a copy of the error with a formatted detail message attached. The caller controls the full error chain via format verbs (e.g. %w to wrap an upstream error). Unlike Detail, Detailf does not implicitly preserve any pre-existing cause — use %w in the format string when wrapping is needed.
func (*Error) Is ¶
Is compares kind and code with another *Error. The standard errors.Is function walks the source error tree to find a match.
func (*Error) PublicDetail ¶
PublicDetail returns optional sanitized client-facing detail.
func (*Error) WithPublicDetail ¶
WithPublicDetail returns a copy of the error with client-facing detail attached. The caller must sanitize the detail before passing it here.
type Kind ¶
type Kind int
Kind classifies an error into a domain-agnostic category.
const ( // KindNotFound indicates the requested resource does not exist. KindNotFound Kind = iota + 1 // not_found // KindAlreadyExists indicates a uniqueness conflict. KindAlreadyExists // already_exists // KindInvalidInput indicates the caller supplied invalid data. KindInvalidInput // invalid_input KindUnauthorized // unauthorized // KindConnectionFailed indicates a connection to an external system failed. KindConnectionFailed // connection_failed // KindTimeout indicates an operation exceeded its deadline. KindTimeout // timeout KindUnavailable // unavailable // KindUnsupported indicates the operation is not supported. KindUnsupported // unsupported // KindForbidden indicates the caller lacks permission. KindForbidden // forbidden // KindInternal indicates an unexpected internal failure. KindInternal // internal )
func KindString ¶
KindString retrieves an enum value from the enum constants string name. Throws an error if the param is not part of the enum.
func (Kind) HTTPStatus ¶
HTTPStatus returns the HTTP status code for the kind.
func (Kind) IsAKind ¶
IsAKind returns "true" if the value is listed in the enum definition. "false" otherwise
func (Kind) MarshalText ¶
MarshalText implements the encoding.TextMarshaler interface for Kind
func (*Kind) UnmarshalText ¶
UnmarshalText implements the encoding.TextUnmarshaler interface for Kind