api_responses

package
v1.49.0 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2022 License: BSD-3-Clause Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClientError

func ClientError(status int, message string) (events.APIGatewayProxyResponse, error)

ClientError creates responses due to request client error

func DatabaseServerError

func DatabaseServerError(err error, msg string) (events.APIGatewayProxyResponse, error)

func DatabaseServerErrorNew

func DatabaseServerErrorNew(err error, msg string) error

func Error

func Error(err error, msg string, statusCode int) (events.APIGatewayProxyResponse, error)

func ErrorFromDBError

func ErrorFromDBError(err error) string

func NewServerError

func NewServerError(err error, msg string) error

func ServerError

func ServerError(err error, msg string) (events.APIGatewayProxyResponse, error)

ServerError logs any error to os.Stderr and returns 500 Internal Server Error response that the AWS API Gateway understands.

func StatusCodeFromSQLError

func StatusCodeFromSQLError(err error) int

Types

type ServerErrorStruct

type ServerErrorStruct struct {
	Message string
	// contains filtered or unexported fields
}

implements error so that API handler can extract the msg

Jump to

Keyboard shortcuts

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