Add missing error page
This commit is contained in:
parent
6181e2968d
commit
dd33c6ab5e
1 changed files with 32 additions and 0 deletions
32
rmo/error.go
Normal file
32
rmo/error.go
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
package rmo
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
//"github.com/Gleipnir-Technology/nidus-sync/config"
|
||||
"github.com/Gleipnir-Technology/nidus-sync/html"
|
||||
)
|
||||
|
||||
type ContentError struct {
|
||||
Code string
|
||||
District *ContentDistrict
|
||||
URL ContentURL
|
||||
}
|
||||
|
||||
func getError(w http.ResponseWriter, r *http.Request) {
|
||||
code := r.FormValue("code")
|
||||
district, err := districtBySlug(r)
|
||||
if err != nil {
|
||||
//respondError(w, "Failed to lookup organization", err, http.StatusBadRequest)
|
||||
district = nil
|
||||
}
|
||||
html.RenderOrError(
|
||||
w,
|
||||
"rmo/error.html",
|
||||
ContentError{
|
||||
Code: code,
|
||||
District: newContentDistrict(district),
|
||||
URL: makeContentURL(nil),
|
||||
},
|
||||
)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue