httperror

package
v0.0.0-...-6d78eec Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package httperror provides HTTP serialization of application errors.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeFromText

func DecodeFromText(response *http.Response) error

DecodeFromText decodes an error from plain text.

func DecodeKind

func DecodeKind(status int) apperror.Kind

DecodeKind maps an HTTP status code to an apperror.Kind.

func EncodeKind

func EncodeKind(kind apperror.Kind) int

EncodeKind maps an apperror.Kind to an HTTP status code.

func EncodeToText

func EncodeToText(w http.ResponseWriter, err error)

EncodeToText encodes an error into plain text. No further writes to the ResponseWriter w should happen after this function.

Types

This section is empty.

Jump to

Keyboard shortcuts

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