federated-dash/cmd/web/error-handlers.go
2024-06-25 11:35:30 -06:00

17 lines
435 B
Go

package main
import (
"net/http"
"runtime/debug"
)
func (app *application) serverError(writer http.ResponseWriter, request *http.Request, err error) {
var(
method = request.Method
uri = request.URL.RequestURI()
trace = string(debug.Stack())
)
app.logger.Error(err.Error(), "method", method, "uri", uri, "trace", trace)
http.Error(writer, http.StatusText(http.StatusInternalServerError), http.StatusInternalServerError)
}