2017-02-06 21:04:29 +00:00
|
|
|
/*
|
|
|
|
Package errhttp provides types errors that make dealing with HTTP response errors easier.
|
|
|
|
|
|
|
|
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
|
2019-07-15 19:31:32 +00:00
|
|
|
case errhttp.InternalServerError:
|
2017-02-06 21:04:29 +00:00
|
|
|
//@TODO
|
|
|
|
|
2019-07-15 19:31:32 +00:00
|
|
|
case errhttp.ClientError:
|
2017-02-06 21:04:29 +00:00
|
|
|
//@TODO
|
2019-07-15 19:31:32 +00:00
|
|
|
case errhttp.ServerError:
|
2017-02-06 21:04:29 +00:00
|
|
|
//@TODO
|
|
|
|
|
|
|
|
default:
|
|
|
|
//@TODO
|
|
|
|
}
|
|
|
|
*/
|
|
|
|
package errhttp
|