From 76cc053aca0078e2e438572819ff85325acb73e9 Mon Sep 17 00:00:00 2001 From: Reindert Vetter Date: Sat, 31 Oct 2020 23:24:09 +0100 Subject: [PATCH] lanvard/lanvard#73 define errors in slice --- .gitignore | 1 + app/report/errors.go | 2 +- src/controller/homepage.go | 5 +++-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 0b8ad7a..0e9548c 100755 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ # Binaries for programs and plugins +main *.exe *.exe~ *.dll diff --git a/app/report/errors.go b/app/report/errors.go index 8b005a4..c754ea0 100644 --- a/app/report/errors.go +++ b/app/report/errors.go @@ -14,7 +14,7 @@ import ( var UserError = errors.New("").Status(net.StatusBadRequest).Level(log_level.INFO) var ValidationError = UserError.Status(net.StatusNotFound) var NotFoundError = UserError.Status(net.StatusNotFound) -var PageNotFoundError = UserError.Wrap("page not found") +var PageNotFoundError = NotFoundError.Wrap("page not found") /** * This list contains errors that indicate that the system is not working diff --git a/src/controller/homepage.go b/src/controller/homepage.go index a635160..d71db6d 100644 --- a/src/controller/homepage.go +++ b/src/controller/homepage.go @@ -2,10 +2,11 @@ package controller import ( "github.com/lanvard/contract/inter" + "github.com/lanvard/errors" "github.com/lanvard/routing/outcome" - "lanvard/app/report" + net "net/http" ) func Homepage(request inter.Request) inter.Response { - return outcome.Html(report.PageNotFoundError) + return outcome.Html(errors.New("ok").Status(net.StatusOK)) }