handle server error
This commit is contained in:
parent
9c7d95f632
commit
693b5bcb8d
1 changed files with 4 additions and 1 deletions
|
|
@ -32,7 +32,10 @@ func New(db *storage.Storage, logger *log.Logger, addr string) *Handler {
|
||||||
func (h *Handler) Start() {
|
func (h *Handler) Start() {
|
||||||
h.startJobs()
|
h.startJobs()
|
||||||
s := &http.Server{Addr: h.Addr, Handler: h}
|
s := &http.Server{Addr: h.Addr, Handler: h}
|
||||||
s.ListenAndServe()
|
err := s.ListenAndServe()
|
||||||
|
if err != http.ErrServerClosed {
|
||||||
|
h.log.Fatal(err)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (h Handler) ServeHTTP(rw http.ResponseWriter, req *http.Request) {
|
func (h Handler) ServeHTTP(rw http.ResponseWriter, req *http.Request) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue