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 502ea33a84 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
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 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
badrequest.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
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 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
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 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
faileddependency.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
forbidden.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
gatewaytimeout.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
gone.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
httpversionnotsupported.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
insufficientstorage.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
internalservererror.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
lengthrequired.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
locked.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
loopdetected.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
methodnotallowed.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
networkauthenticationrequired.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
notacceptable.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
notextended.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
notfound.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
notimplemented.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
payloadtoolarge.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
paymentrequired.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
preconditionfailed.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
preconditionrequired.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
proxyauthrequired.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
requestedrangenotsatisfiable.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
requestentitytoolarge.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
requestheaderfieldstoolarge.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
requesttimeout.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
requesturitoolong.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
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 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
teapot.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
toomanyrequests.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
unauthorized.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
unavailableforlegalreasons.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
unprocessableentity.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
unsupportedmediatype.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
upgraderequired.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
uritoolong.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
variantaisonegotiates.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

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