Documentation
¶
Index ¶
Constants ¶
const ( ClientIDTaskNotFound = iota + 1000 ClientIDInput ClientIDRunNotFound ClientIDRunCannotDelete ClientUnknownApiKey )
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 [github.com/wndhydrnt/saturn-bot/pkg/server/api/openapi.Error].
ToApiError() openapi.Error
}
Client defines an interface for errors caused by invalid inputs sent by a client.
func NewRunCannotDeleteError ¶ added in v0.21.0
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 ¶ added in v0.20.0
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 ¶ added in v0.20.0
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) Error ¶ added in v0.20.0
func (e InputError) Error() string
Error implements error.
func (InputError) ErrorID ¶ added in v0.20.0
func (e InputError) ErrorID() int
ErrorID implements Client.
func (InputError) ToApiError ¶ added in v0.20.0
func (e InputError) ToApiError() openapi.Error
ToApiError implements Client.