Refactor: change number of return parameters from page functions, include error handling in wrapper
This commit is contained in:
@@ -10,7 +10,6 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"net/http"
|
||||
|
||||
"git.erbosoft.com/amy/amsterdam/ui"
|
||||
@@ -19,7 +18,10 @@ import (
|
||||
)
|
||||
|
||||
// ENOPERM is the standard "not permitted" error message.
|
||||
var ENOPERM error = errors.New("you are not permitted to perform this operation")
|
||||
var ENOPERM *echo.HTTPError = echo.NewHTTPError(http.StatusForbidden, "you are not permitted to perform this operation")
|
||||
|
||||
// ENOACCESS is the standard "no access" error message.
|
||||
var ENOACCESS *echo.HTTPError = echo.NewHTTPError(http.StatusForbidden, "you are not permitted to access this page")
|
||||
|
||||
/* NotImplPage is used for all TODO links, to show that something hasn't yet been implemented.
|
||||
* Parameters:
|
||||
@@ -29,11 +31,11 @@ var ENOPERM error = errors.New("you are not permitted to perform this operation"
|
||||
* Data as a parameter for the command string.
|
||||
* Standard Go error status.
|
||||
*/
|
||||
func NotImplPage(ctxt ui.AmContext) (string, any, error) {
|
||||
func NotImplPage(ctxt ui.AmContext) (string, any) {
|
||||
ctxt.SetLeftMenu("top")
|
||||
ctxt.VarMap().Set("amsterdam_pageTitle", "Function Not Implemented")
|
||||
ctxt.VarMap().Set("path", ctxt.URLPath())
|
||||
return "framed_template", "notimpl.jet", nil
|
||||
return "framed", "notimpl.jet"
|
||||
}
|
||||
|
||||
/* AmErrorHandler handles all the mundane HTTP errors generated by the Echo engine.
|
||||
|
||||
Reference in New Issue
Block a user