lazyengineering / faststatus

Simple API for sharing if a resource is free, busy, or very busy
MIT License
1 stars 2 forks source link

REST errors #43

Closed jessecarl closed 7 years ago

jessecarl commented 7 years ago

Instead of having http.Error() and return scattered throughout the codebase, have a single location for handling errors. This may be done by providing an internal handler and handlerFunc type that match the http.Handler but return an error. This, along with an error type that indicates the http status code to use would greatly simplify the handlers and enable more robust and unified error response and logging for the server.