mirror of
https://github.com/astaxie/beego.git
synced 2024-11-25 23:21:45 +00:00
Merge pull request #438 from Codonaut/error_page_improvements
Error page improvements
This commit is contained in:
commit
20cfece1ab
@ -185,7 +185,7 @@ func NotFound(rw http.ResponseWriter, r *http.Request) {
|
|||||||
t, _ := template.New("beegoerrortemp").Parse(errtpl)
|
t, _ := template.New("beegoerrortemp").Parse(errtpl)
|
||||||
data := make(map[string]interface{})
|
data := make(map[string]interface{})
|
||||||
data["Title"] = "Page Not Found"
|
data["Title"] = "Page Not Found"
|
||||||
data["Content"] = template.HTML("<br>The Page You have requested flown the coop." +
|
data["Content"] = template.HTML("<br>The page you have requested has flown the coop." +
|
||||||
"<br>Perhaps you are here because:" +
|
"<br>Perhaps you are here because:" +
|
||||||
"<br><br><ul>" +
|
"<br><br><ul>" +
|
||||||
"<br>The page has moved" +
|
"<br>The page has moved" +
|
||||||
@ -203,11 +203,11 @@ func Unauthorized(rw http.ResponseWriter, r *http.Request) {
|
|||||||
t, _ := template.New("beegoerrortemp").Parse(errtpl)
|
t, _ := template.New("beegoerrortemp").Parse(errtpl)
|
||||||
data := make(map[string]interface{})
|
data := make(map[string]interface{})
|
||||||
data["Title"] = "Unauthorized"
|
data["Title"] = "Unauthorized"
|
||||||
data["Content"] = template.HTML("<br>The Page You have requested can't authorized." +
|
data["Content"] = template.HTML("<br>The page you have requested can't be authorized." +
|
||||||
"<br>Perhaps you are here because:" +
|
"<br>Perhaps you are here because:" +
|
||||||
"<br><br><ul>" +
|
"<br><br><ul>" +
|
||||||
"<br>Check the credentials that you supplied" +
|
"<br>The credentials you supplied are incorrect" +
|
||||||
"<br>Check the address for errors" +
|
"<br>There are errors in the website address" +
|
||||||
"</ul>")
|
"</ul>")
|
||||||
data["BeegoVersion"] = VERSION
|
data["BeegoVersion"] = VERSION
|
||||||
//rw.WriteHeader(http.StatusUnauthorized)
|
//rw.WriteHeader(http.StatusUnauthorized)
|
||||||
@ -219,7 +219,7 @@ func Forbidden(rw http.ResponseWriter, r *http.Request) {
|
|||||||
t, _ := template.New("beegoerrortemp").Parse(errtpl)
|
t, _ := template.New("beegoerrortemp").Parse(errtpl)
|
||||||
data := make(map[string]interface{})
|
data := make(map[string]interface{})
|
||||||
data["Title"] = "Forbidden"
|
data["Title"] = "Forbidden"
|
||||||
data["Content"] = template.HTML("<br>The Page You have requested forbidden." +
|
data["Content"] = template.HTML("<br>The page you have requested is forbidden." +
|
||||||
"<br>Perhaps you are here because:" +
|
"<br>Perhaps you are here because:" +
|
||||||
"<br><br><ul>" +
|
"<br><br><ul>" +
|
||||||
"<br>Your address may be blocked" +
|
"<br>Your address may be blocked" +
|
||||||
@ -236,7 +236,7 @@ func ServiceUnavailable(rw http.ResponseWriter, r *http.Request) {
|
|||||||
t, _ := template.New("beegoerrortemp").Parse(errtpl)
|
t, _ := template.New("beegoerrortemp").Parse(errtpl)
|
||||||
data := make(map[string]interface{})
|
data := make(map[string]interface{})
|
||||||
data["Title"] = "Service Unavailable"
|
data["Title"] = "Service Unavailable"
|
||||||
data["Content"] = template.HTML("<br>The Page You have requested unavailable." +
|
data["Content"] = template.HTML("<br>The page you have requested is unavailable." +
|
||||||
"<br>Perhaps you are here because:" +
|
"<br>Perhaps you are here because:" +
|
||||||
"<br><br><ul>" +
|
"<br><br><ul>" +
|
||||||
"<br><br>The page is overloaded" +
|
"<br><br>The page is overloaded" +
|
||||||
@ -252,11 +252,10 @@ func InternalServerError(rw http.ResponseWriter, r *http.Request) {
|
|||||||
t, _ := template.New("beegoerrortemp").Parse(errtpl)
|
t, _ := template.New("beegoerrortemp").Parse(errtpl)
|
||||||
data := make(map[string]interface{})
|
data := make(map[string]interface{})
|
||||||
data["Title"] = "Internal Server Error"
|
data["Title"] = "Internal Server Error"
|
||||||
data["Content"] = template.HTML("<br>The Page You have requested has down now." +
|
data["Content"] = template.HTML("<br>The page you have requested is down right now." +
|
||||||
"<br><br><ul>" +
|
"<br><br><ul>" +
|
||||||
"<br>simply try again later" +
|
"<br>Please try again later and report the error to the website administrator" +
|
||||||
"<br>you should report the fault to the website administrator" +
|
"<br></ul>")
|
||||||
"</ul>")
|
|
||||||
data["BeegoVersion"] = VERSION
|
data["BeegoVersion"] = VERSION
|
||||||
//rw.WriteHeader(http.StatusInternalServerError)
|
//rw.WriteHeader(http.StatusInternalServerError)
|
||||||
t.Execute(rw, data)
|
t.Execute(rw, data)
|
||||||
|
Loading…
Reference in New Issue
Block a user