From f97d476b495126fd2474b8e3a2968658395d2a0f Mon Sep 17 00:00:00 2001 From: Alex Date: Wed, 13 Mar 2024 17:09:48 -0400 Subject: Complete restructure --- errors.go | 23 ----------------------- 1 file changed, 23 deletions(-) delete mode 100644 errors.go (limited to 'errors.go') diff --git a/errors.go b/errors.go deleted file mode 100644 index 9406a9a..0000000 --- a/errors.go +++ /dev/null @@ -1,23 +0,0 @@ -package main - -import ( - "fmt" - "net/http" - "runtime/debug" -) - -func (app *application) serverError(w http.ResponseWriter, err error) { - trace := fmt.Sprintf("%s\n%s", err.Error(), debug.Stack()) - app.errorLog.Output(2, trace) - - http.Error(w, http.StatusText(http.StatusInternalServerError), http.StatusInternalServerError) -} - -func (app *application) clientError(w http.ResponseWriter, status int) { - app.errorLog.Printf("Clent error: %d\n", status) - http.Error(w, http.StatusText(status), status) -} - -func (app *application) notFound(w http.ResponseWriter) { - app.clientError(w, http.StatusNotFound) -} -- cgit v1.2.3