Package errhttp provides errors and types that make dealing with HTTP response errors easier, for the Go programming language.
Go to file
Charles Iliya Krempeaux 34675d3edc modified package-level global errors in the way the new error package Unwrap(), etc understands it 2023-08-14 05:30:30 -07:00
LICENSE initial commit 2017-02-06 12:57:57 -08:00
README.md correction to docs. corrected typo. 2019-07-15 12:31:32 -07:00
badgateway.go modified package-level global errors in the way the new error package Unwrap(), etc understands it 2023-08-14 05:30:30 -07:00
badrequest.go modified package-level global errors in the way the new error package Unwrap(), etc understands it 2023-08-14 05:30:30 -07:00
clienterror.go client errors 2017-02-06 12:58:13 -08:00
clienterror_test.go client errors 2017-02-06 12:58:13 -08:00
conflict.go modified package-level global errors in the way the new error package Unwrap(), etc understands it 2023-08-14 05:30:30 -07:00
doc.go correction to docs. corrected typo. 2019-07-15 12:31:32 -07:00
error.go removed Err() method. deal with internal type fitting interface in another way (other than a unit test) 2023-08-14 05:03:00 -07:00
expectationfailed.go modified package-level global errors in the way the new error package Unwrap(), etc understands it 2023-08-14 05:30:30 -07:00
faileddependency.go modified package-level global errors in the way the new error package Unwrap(), etc understands it 2023-08-14 05:30:30 -07:00
forbidden.go modified package-level global errors in the way the new error package Unwrap(), etc understands it 2023-08-14 05:30:30 -07:00
gatewaytimeout.go modified package-level global errors in the way the new error package Unwrap(), etc understands it 2023-08-14 05:30:30 -07:00
gone.go modified package-level global errors in the way the new error package Unwrap(), etc understands it 2023-08-14 05:30:30 -07:00
httpversionnotsupported.go modified package-level global errors in the way the new error package Unwrap(), etc understands it 2023-08-14 05:30:30 -07:00
insufficientstorage.go modified package-level global errors in the way the new error package Unwrap(), etc understands it 2023-08-14 05:30:30 -07:00
internalservererror.go modified package-level global errors in the way the new error package Unwrap(), etc understands it 2023-08-14 05:30:30 -07:00
lengthrequired.go modified package-level global errors in the way the new error package Unwrap(), etc understands it 2023-08-14 05:30:30 -07:00
locked.go modified package-level global errors in the way the new error package Unwrap(), etc understands it 2023-08-14 05:30:30 -07:00
loopdetected.go modified package-level global errors in the way the new error package Unwrap(), etc understands it 2023-08-14 05:30:30 -07:00
methodnotallowed.go modified package-level global errors in the way the new error package Unwrap(), etc understands it 2023-08-14 05:30:30 -07:00
networkauthenticationrequired.go modified package-level global errors in the way the new error package Unwrap(), etc understands it 2023-08-14 05:30:30 -07:00
notacceptable.go modified package-level global errors in the way the new error package Unwrap(), etc understands it 2023-08-14 05:30:30 -07:00
notextended.go modified package-level global errors in the way the new error package Unwrap(), etc understands it 2023-08-14 05:30:30 -07:00
notfound.go modified package-level global errors in the way the new error package Unwrap(), etc understands it 2023-08-14 05:30:30 -07:00
notimplemented.go modified package-level global errors in the way the new error package Unwrap(), etc understands it 2023-08-14 05:30:30 -07:00
payloadtoolarge.go modified package-level global errors in the way the new error package Unwrap(), etc understands it 2023-08-14 05:30:30 -07:00
paymentrequired.go modified package-level global errors in the way the new error package Unwrap(), etc understands it 2023-08-14 05:30:30 -07:00
preconditionfailed.go modified package-level global errors in the way the new error package Unwrap(), etc understands it 2023-08-14 05:30:30 -07:00
preconditionrequired.go modified package-level global errors in the way the new error package Unwrap(), etc understands it 2023-08-14 05:30:30 -07:00
proxyauthrequired.go modified package-level global errors in the way the new error package Unwrap(), etc understands it 2023-08-14 05:30:30 -07:00
requestedrangenotsatisfiable.go modified package-level global errors in the way the new error package Unwrap(), etc understands it 2023-08-14 05:30:30 -07:00
requestentitytoolarge.go modified package-level global errors in the way the new error package Unwrap(), etc understands it 2023-08-14 05:30:30 -07:00
requestheaderfieldstoolarge.go modified package-level global errors in the way the new error package Unwrap(), etc understands it 2023-08-14 05:30:30 -07:00
requesttimeout.go modified package-level global errors in the way the new error package Unwrap(), etc understands it 2023-08-14 05:30:30 -07:00
requesturitoolong.go modified package-level global errors in the way the new error package Unwrap(), etc understands it 2023-08-14 05:30:30 -07:00
servererror.go client errors 2017-02-06 12:58:13 -08:00
servererror_test.go server error 2017-02-06 13:14:15 -08:00
serviceunavailable.go modified package-level global errors in the way the new error package Unwrap(), etc understands it 2023-08-14 05:30:30 -07:00
teapot.go modified package-level global errors in the way the new error package Unwrap(), etc understands it 2023-08-14 05:30:30 -07:00
toomanyrequests.go modified package-level global errors in the way the new error package Unwrap(), etc understands it 2023-08-14 05:30:30 -07:00
unauthorized.go modified package-level global errors in the way the new error package Unwrap(), etc understands it 2023-08-14 05:30:30 -07:00
unavailableforlegalreasons.go modified package-level global errors in the way the new error package Unwrap(), etc understands it 2023-08-14 05:30:30 -07:00
unprocessableentity.go modified package-level global errors in the way the new error package Unwrap(), etc understands it 2023-08-14 05:30:30 -07:00
unsupportedmediatype.go modified package-level global errors in the way the new error package Unwrap(), etc understands it 2023-08-14 05:30:30 -07:00
upgraderequired.go modified package-level global errors in the way the new error package Unwrap(), etc understands it 2023-08-14 05:30:30 -07:00
uritoolong.go modified package-level global errors in the way the new error package Unwrap(), etc understands it 2023-08-14 05:30:30 -07:00
variantaisonegotiates.go modified package-level global errors in the way the new error package Unwrap(), etc understands it 2023-08-14 05:30:30 -07:00

README.md

go-errhttp

Package errhttp provides types errors that make dealing with HTTP response errors easier, for the Go programming language.

Example

	import "github.com/reiver/go-errhttp"
	
	// ...
	
	if err := something(); nil != err {
		return errhttp.BadRequestWrap(err)
	}
	
	// ...
	
	switch err.(type) {
	case errhttp.BadRequest:
		//@TODO
	case errhttp.NotFound:
		//@TODO
	case errhttp.InternalServerError:
		//@TODO
	
	case errhttp.ClientError:
		//@TODO
	case errhttp.ServerError:
		//@TODO
	
	default:
		//@TODO
	}

Documention

Online documentation, which includes examples, can be found at: http://godoc.org/github.com/reiver/go-errhttp

GoDoc