errors

package
v0.4.17 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Conflict

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

Conflict represents a conflict error in the application.

func NewConflict

func NewConflict(message string, err ...error) Conflict

NewConflict creates a new Conflict error with the provided message.

func (Conflict) Error

func (c Conflict) Error() string

Error returns the error message for Conflict.

type EditedBriefExists added in v0.3.0

type EditedBriefExists struct {

	// Revision is the current revision of the edited brief.
	Revision uint64
	// contains filtered or unexported fields
}

EditedBriefExists is a 409 specific to the weekly-brief generate flow — distinguished from generic Conflict so the handler can attach the current brief revision to the response body.

func NewEditedBriefExists added in v0.3.0

func NewEditedBriefExists(revision uint64) EditedBriefExists

NewEditedBriefExists creates an EditedBriefExists conflict error.

func (EditedBriefExists) Error added in v0.3.0

func (e EditedBriefExists) Error() string

Error returns the error message for EditedBriefExists.

type Forbidden added in v0.2.22

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

Forbidden represents a forbidden error in the application.

func NewForbidden added in v0.2.22

func NewForbidden(message string, errs ...error) Forbidden

NewForbidden creates a new Forbidden error with the provided message.

func (Forbidden) Error added in v0.2.22

func (f Forbidden) Error() string

Error returns the error message for Forbidden.

type NotFound

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

NotFound represents a not found error in the application.

func NewNotFound

func NewNotFound(message string, err ...error) NotFound

NewNotFound creates a new NotFound error with the provided message.

func (NotFound) Error

func (v NotFound) Error() string

Error returns the error message for NotFound.

type RevisionMismatch added in v0.4.2

type RevisionMismatch struct {

	// Revision is the brief's current (server-side) revision.
	Revision uint64
	// contains filtered or unexported fields
}

RevisionMismatch is a 409 specific to the weekly-brief edit/save flow — returned when the caller's optimistic-concurrency token does not match the brief's current revision (someone else edited in the meantime). Distinguished from generic Conflict so the handler can attach the current revision to the response body, letting the client refetch and retry.

func NewRevisionMismatch added in v0.4.2

func NewRevisionMismatch(revision uint64) RevisionMismatch

NewRevisionMismatch creates a RevisionMismatch conflict error carrying the brief's current revision.

func (RevisionMismatch) Error added in v0.4.2

func (e RevisionMismatch) Error() string

Error returns the error message for RevisionMismatch.

type ServiceUnavailable

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

ServiceUnavailable represents a service unavailability error in the application.

func NewServiceUnavailable

func NewServiceUnavailable(message string, err ...error) ServiceUnavailable

NewServiceUnavailable creates a new ServiceUnavailable error with the provided message.

func (ServiceUnavailable) Error

func (su ServiceUnavailable) Error() string

Error returns the error message for ServiceUnavailable.

type TooManyRequests added in v0.3.0

type TooManyRequests struct {

	// GeneratesUsed is the count consumed for fresh generations in this window.
	GeneratesUsed int
	// GeneratesLimit is the cap on fresh generations.
	GeneratesLimit int
	// RegenerationsUsed is the count consumed for regenerations.
	RegenerationsUsed int
	// RegenerationsLimit is the cap on regenerations.
	RegenerationsLimit int
	// WindowResetsAt is the timestamp at which the window resets.
	WindowResetsAt string
	// contains filtered or unexported fields
}

TooManyRequests is a 429 — used by weekly-brief throttle enforcement to carry the per-window throttle counters back to the HTTP layer without stringifying them. Handlers extract the typed value via errors.As.

func NewTooManyRequests added in v0.3.0

func NewTooManyRequests(message string, generatesUsed, generatesLimit, regenerationsUsed, regenerationsLimit int, windowResetsAt string) TooManyRequests

NewTooManyRequests creates a TooManyRequests error.

func (TooManyRequests) Error added in v0.3.0

func (t TooManyRequests) Error() string

Error returns the error message for TooManyRequests.

type Unexpected

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

Unexpected represents an unexpected error in the application.

func NewUnexpected

func NewUnexpected(message string, err ...error) Unexpected

NewUnexpected creates a new Unexpected error with the provided message.

func (Unexpected) Error

func (u Unexpected) Error() string

Error returns the error message for Unexpected.

type Validation

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

Validation represents a validation error in the application.

func NewValidation

func NewValidation(message string, err ...error) Validation

NewValidation creates a new Validation error with the provided message.

func (Validation) Error

func (v Validation) Error() string

Error returns the error message for Validation.

Jump to

Keyboard shortcuts

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