lyserr

package
v0.1.26 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2024 License: MIT Imports: 2 Imported by: 1

Documentation

Overview

Package lyserr contains structs related to error handling used in lys and lyspg.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Db added in v0.1.25

type Db struct {
	Err  error
	Stmt string // the SQL statement that caused the error
}

Db is an error that comes from the Postgres database. It might contain a wrapped pgx PgError.

func (Db) Error added in v0.1.25

func (e Db) Error() string

func (Db) Unwrap added in v0.1.25

func (e Db) Unwrap() error

type Ext added in v0.1.25

type Ext struct {
	Err     error
	Message string // user-readable message from the API
}

Ext is an error that comes from an external API. It should be both logged, and the message shown to users

func (Ext) Error added in v0.1.25

func (e Ext) Error() string

type User

type User struct {
	Message    string // shown to user to help him identify error
	StatusCode int    // optional, for HTTP server: if not supplied, 400 - BadRequest will be used
}

User is an error that is caused by the user and should be reported back to him and not logged

func (User) Error

func (e User) Error() string

Jump to

Keyboard shortcuts

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