This commit is contained in:
lbenedar
2026-03-10 16:00:53 +03:00
parent b4ea20d1d3
commit 71f15d1131
4 changed files with 43 additions and 3 deletions

View File

@@ -15,7 +15,7 @@ func (app *application) createMovieHandler(w http.ResponseWriter, r *http.Reques
func (app *application) showMovieHandler(w http.ResponseWriter, r *http.Request) {
id, err := app.readIDParam(r)
if err != nil {
http.NotFound(w, r)
app.notFoundResponse(w, r)
return
}
@@ -31,6 +31,6 @@ func (app *application) showMovieHandler(w http.ResponseWriter, r *http.Request)
err = app.writeJSON(w, http.StatusOK, envelope{"movie": movie}, nil)
if err != nil {
app.logger.Print(err)
http.Error(w, "The server encountered a problem and could not process your request", http.StatusInternalServerError)
app.serverErrorResponse(w, r, err)
}
}