rest_err

package
v0.0.0-...-db40093 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2021 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIError

type APIError interface {
	Message() string
	Status() int
	Error() string
	Causes() []interface{}
}

APIError interface untuk mengembalikan error

func NewAPIError

func NewAPIError(message string, statusCode int, err string, causes []interface{}) APIError

NewAPIError membuat api error baru dengan mendifinisikan semua isinyas

func NewAPIErrorFromBytes

func NewAPIErrorFromBytes(body []byte) (APIError, error)

NewAPIErrorFromBytes membuat api error dari []byte

func NewBadRequestError

func NewBadRequestError(message string) APIError

NewBadRequestError membuat error jika kesalahan ada pada user

func NewInternalServerError

func NewInternalServerError(message string, err error) APIError

NewInternalServerError membuat error 500 internal

func NewNotFoundError

func NewNotFoundError(message string) APIError

NewNotFoundError membuat api error ketika objek yang dicari tidak ditemukan

func NewUnauthorizedError

func NewUnauthorizedError(message string) APIError

NewUnauthorizedError membuat api error user yang tidak diijinkan masuk

Jump to

Keyboard shortcuts

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