errhttp

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2024 License: Apache-2.0 Imports: 4 Imported by: 16

Documentation

Overview

Package errhttp provides utility functions for translating errors to and from a HTTP context.

The functions ToHTTP and ToNative can be used to map server-side and client-side errors to the correct types.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ToHTTP

func ToHTTP(err error) int

ToHTTP returns the best status code for the given error

func ToNative

func ToNative(statusCode int) error

ToNative returns the error best matching the HTTP status code

Types

This section is empty.

Jump to

Keyboard shortcuts

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