Documentation
¶
Index ¶
Constants ¶
View Source
const ( ClientIDTaskNotFound = iota + 1000 ClientIDInput ClientIDRunNotFound ClientIDRunCannotDelete ClientUnknownApiKey )
View Source
const (
ServerIDDefault = iota + 2000
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface {
// Client indicates that this is a client error.
Client()
// Error implements [error].
// It returns the human-readable message of the error.
Error() string
// ErrorID returns the internal identifier of the error.
ErrorID() int
// ToApiError is a helper method that maps the error to an [codeberg.org/saturn-sync/saturn/pkg/server/api/openapi.Error].
ToApiError() openapi.Error
}
Client defines an interface for errors caused by invalid inputs sent by a client.
func NewRunCannotDeleteError ¶
func NewRunCannotDeleteError() Client
NewRunCannotDeleteError returns a client error that indicates that the run cannot be deleted.
func NewRunNotFoundError ¶
NewTaskNotFoundError returns a client error that indicates that the run identified by id doesn't exist.
func NewTaskNotFoundError ¶
NewTaskNotFoundError returns a client error that indicates that a task hasn't been found.
type InputError ¶
type InputError struct {
// contains filtered or unexported fields
}
InputError is a specific implementation of Client. It wraps all errors that occurred during validation of inputs.
func NewInputError ¶
func NewInputError(errors []error, taskName string) InputError
NewInputError returns a client error that indicates that an expected input of a task isn't set.
func (InputError) ToApiError ¶
func (e InputError) ToApiError() openapi.Error
ToApiError implements Client.
Click to show internal directories.
Click to hide internal directories.