From 03f78b2e4a5353173d96cbfbe19a3195cdc032f4 Mon Sep 17 00:00:00 2001
From: Chenrui <631807682@qq.com>
Date: Wed, 8 Jul 2020 18:09:01 +0800
Subject: [PATCH] fix: add error code support
---
error.go | 15 ++++++++++++++-
hooks.go | 1 +
2 files changed, 15 insertions(+), 1 deletion(-)
diff --git a/error.go b/error.go
index e5e9fd47..0b148974 100644
--- a/error.go
+++ b/error.go
@@ -28,7 +28,7 @@ import (
)
const (
- errorTypeHandler = iota
+ errorTypeHandler = iota
errorTypeController
)
@@ -359,6 +359,19 @@ func gatewayTimeout(rw http.ResponseWriter, r *http.Request) {
)
}
+// show 413 Payload Too Large
+func payloadTooLarge(rw http.ResponseWriter, r *http.Request) {
+ responseError(rw, r,
+ 413,
+ "
The page you have requested is unavailable."+
+ "
Perhaps you are here because:"+
+ "