summary refs log tree commit diff
path: root/handlers/handler.go
diff options
context:
space:
mode:
Diffstat (limited to 'handlers/handler.go')
-rw-r--r--handlers/handler.go9
1 files changed, 7 insertions, 2 deletions
diff --git a/handlers/handler.go b/handlers/handler.go
index 56801a3..d6e1b5b 100644
--- a/handlers/handler.go
+++ b/handlers/handler.go
@@ -76,6 +76,11 @@ func (h *RequestHandler) HandleRequest(ctx *fasthttp.RequestCtx) {
 // information.
 func (h *RequestHandler) handleUnknownRequest(ctx *fasthttp.RequestCtx) {
 	// TODO: Show error page
-	ctx.SetStatusCode(http.StatusNotFound)
-	_, _ = ctx.WriteString("Unknown request.")
+	ctx.Error("Unknown request.", http.StatusNotFound)
+}
+
+// handleUnknownRequest handles errors which occurred during a request with a generic message.
+func (h *RequestHandler) handleError(ctx *fasthttp.RequestCtx) {
+	// TODO: Show error page
+	ctx.Error("An error occurred", http.StatusInternalServerError)
 }