mock_errors

package
v1.1.25 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2025 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. SPDX-License-Identifier: Apache-2.0

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetErrorBytes

func GetErrorBytes(statusCode int, err error, message string) []byte

func WriteBadRequest

func WriteBadRequest(w http.ResponseWriter, message string)

func WriteForbidden

func WriteForbidden(w http.ResponseWriter, message string)

func WriteNotFound

func WriteNotFound(w http.ResponseWriter, message string)

func WriteServerError

func WriteServerError(w http.ResponseWriter, message string)

func WriteUnauthorized

func WriteUnauthorized(w http.ResponseWriter, message string)

func WriteUnprocessableEntity added in v1.1.16

func WriteUnprocessableEntity(w http.ResponseWriter, message string)

Types

type ErrorMessage

type ErrorMessage struct {
	StatusCode int    `json:"status"`
	Error      string `json:"error"`
	Message    string `json:"message"`
}

Jump to

Keyboard shortcuts

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