resterrors

package module
v0.0.0-...-d66d24a Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2021 License: MIT Imports: 3 Imported by: 1

README

restErrors

Common errors for a rest api

Documentation

Overview

Common errors utility

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewError

func NewError(msg string) error

Types

type RestErr

type RestErr struct {
	Message string `json:"message"`
	Status  int    `json:"status"`
	Error   string `json:"error"`
}

func NewBadRequestError

func NewBadRequestError(message string) *RestErr

func NewInternalServerError

func NewInternalServerError(message string) *RestErr

func NewNotFoundError

func NewNotFoundError(message string) *RestErr

func NewNotImplementedError

func NewNotImplementedError(message string) *RestErr

func NewRestErrorFromBytes

func NewRestErrorFromBytes(bytes []byte) (*RestErr, error)

func NewUnauthorized

func NewUnauthorized(message string) *RestErr

NewUnathorized

Jump to

Keyboard shortcuts

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