go-errhttp/README.md

41 lines
784 B
Markdown
Raw Normal View History

2017-02-06 20:57:57 +00:00
# go-errhttp
2017-02-06 21:04:29 +00:00
Package **errhttp** provides types errors that make dealing with HTTP response errors easier, for the Go programming language.
2017-02-06 20:57:57 +00:00
2017-02-06 21:04:29 +00:00
## Example
```go
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 errhtp.InternalServerError:
//@TODO
case errhtp.ClientError:
//@TODO
case errhtp.ServerError:
//@TODO
default:
//@TODO
}
```
2017-02-06 20:57:57 +00:00
## Documention
Online documentation, which includes examples, can be found at: http://godoc.org/github.com/reiver/go-errhttp
[![GoDoc](https://godoc.org/github.com/reiver/go-errhttp?status.svg)](https://godoc.org/github.com/reiver/go-errhttp)