errors

package
v0.0.0-...-7e7cc72 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrFileFormat = HttpError{
		ResponseCode: http.StatusBadRequest,
		Text:         "file format error",
		ErrorCode:    1,
	}

	ErrMaxFileSize = HttpError{
		ResponseCode: http.StatusRequestEntityTooLarge,
		Text:         "max file size bytes",
		ErrorCode:    2,
	}

	ErrTokenFormat = HttpError{
		ResponseCode: http.StatusBadRequest,
		Text:         "token format error",
		ErrorCode:    3,
	}

	ErrUploadFile = HttpError{
		ResponseCode: http.StatusInternalServerError,
		Text:         "failed to download file",
		ErrorCode:    4,
	}

	ErrFileNotFound = HttpError{
		ResponseCode: http.StatusNotFound,
		Text:         "failed to find file",
		ErrorCode:    5,
	}

	ErrDownloadFile = HttpError{
		ResponseCode: http.StatusInternalServerError,
		Text:         "failed to download file",
		ErrorCode:    6,
	}
)

Functions

func Is

func Is(err error, target error) bool

func New

func New(s string) error

Types

type HttpError

type HttpError struct {
	ResponseCode int    `json:"-"`
	ErrorCode    int    `json:"error_code"`
	Text         string `json:"text"`
}

func (HttpError) Error

func (e HttpError) Error() string

func (HttpError) String

func (e HttpError) String() string

Jump to

Keyboard shortcuts

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