errs

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2021 License: GPL-3.0 Imports: 1 Imported by: 1

Documentation

Overview

Provides implementation of errors for this project.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApiError

type ApiError struct {
	Err  string `json:"error"`
	Msg  string `json:"message"`
	Code int    `json:"code"`
}

ApiError is a general error struct for consuming and returning api errors.

ApiError implements error interface.

func New

func New(err string, msg string) *ApiError

Creates a new ApiError

func New2 added in v0.0.8

func New2(err string, msg string, code int) *ApiError

Creates a new ApiError

func (*ApiError) Error

func (e *ApiError) Error() string

implements the error interface for ApiError

Jump to

Keyboard shortcuts

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