api

package
v0.6.10-0...-926069d Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2023 License: GPL-3.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultErrorCode = ErrorCode("unknown_error")

Variables

This section is empty.

Functions

This section is empty.

Types

type Error

type Error struct {
	ErrorCode     ErrorCode
	UserMessage   string
	InternalError error
}

supposedly, having a public error type in Go is an antipattern however, all usecase methods will return this expected structure and the gateways will all require this metadata to return a proper error so I believe it's worth trying a concrete error type instead of a bunch of package methods that guess at your error's insides

func CommitError

func CommitError(err error, errorCode ErrorCode, userMessage string) *Error

func WrapError

func WrapError(err *Error, msg string) *Error

func (Error) Cause

func (e Error) Cause() error

func (Error) Error

func (e Error) Error() string

type ErrorCode

type ErrorCode string

Jump to

Keyboard shortcuts

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