commanderrors

package module
v0.0.0-...-8b2a65a Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2022 License: MIT Imports: 4 Imported by: 0

README

Command Errors

A collection of pre-created command errors and an error handler for the Router.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ErrorHandler

func ErrorHandler(logger zerolog.Logger) func(err error) *objects.InteractionResponse

Types

type CommandError

type CommandError interface {
	Error() string
	Command() string
}

CommandError is an error that is returned when a command fails

type ErrCommandNotAllowed

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

ErrCommandNotAllowed is an error that is returned when the running user is not currently allowed to run a command

func NewErrCommandNotAllowed

func NewErrCommandNotAllowed(command *router.Command) *ErrCommandNotAllowed

func (*ErrCommandNotAllowed) Command

func (e *ErrCommandNotAllowed) Command() string

func (*ErrCommandNotAllowed) Error

func (e *ErrCommandNotAllowed) Error() string

type ErrCommandNotImplemented

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

ErrCommandNotImplemented is an error that is returned when a command is not implemented

func NewErrCommandNotImplemented

func NewErrCommandNotImplemented(command *router.Command) *ErrCommandNotImplemented

func (*ErrCommandNotImplemented) Command

func (e *ErrCommandNotImplemented) Command() string

func (*ErrCommandNotImplemented) Error

func (e *ErrCommandNotImplemented) Error() string

type ErrRuntime

type ErrRuntime struct {
	Value string
	// contains filtered or unexported fields
}

ErrRuntime represents a generic runtime error

func NewErrRuntime

func NewErrRuntime(command *router.Command, value string) *ErrRuntime

func (*ErrRuntime) Command

func (e *ErrRuntime) Command() string

func (*ErrRuntime) Error

func (e *ErrRuntime) Error() string

Jump to

Keyboard shortcuts

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