shared

package
v0.4.9 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindSmallestImageUrlOrEmpty

func FindSmallestImageUrlOrEmpty(images []spotify.Image) (smallestImageUrl string)

Types

type SpotifeteError

type SpotifeteError struct {
	MessageForUser string
	HttpStatus     int
}

func NewError

func NewError(message string, cause error, httpStatus int) *SpotifeteError

Creates an error struct with the supplied message, cause and http status code The message and cause will be logged

This is useful for most cases, where the reason might be interesting for the user

func NewInternalError

func NewInternalError(message string, cause error) *SpotifeteError

Creates an error struct with a standard message and http status 500 (Internal Server Error) The message and cause will be logged

This is useful if you don't want the user to see the details of the error

func NewUserError

func NewUserError(message string) *SpotifeteError

Creates an error struct with the supplied message and http status 400 (Bad Request) Nothing will be logged

This is useful for user errors like missing parameters

Jump to

Keyboard shortcuts

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