feat(gallery): routes
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
package resthome
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"net/http"
|
||||
|
||||
@@ -24,6 +26,10 @@ func (h *Handler) page(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
page, err := h.src.GetPage(r.Context(), uid)
|
||||
if err != nil {
|
||||
if errors.Is(err, context.Canceled) {
|
||||
w.WriteHeader(http.StatusRequestTimeout)
|
||||
}
|
||||
|
||||
w.WriteHeader(http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user