From 109f27170a231d1570ad9f0b97fea8b409fa2f89 Mon Sep 17 00:00:00 2001 From: Henrique Dias Date: Fri, 16 Oct 2015 20:03:59 +0100 Subject: [PATCH] fix #26 --- browse/browse.go | 3 ++- editor/editor.go | 3 ++- editor/post.go | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/browse/browse.go b/browse/browse.go index 8527d6c5..1463b22b 100644 --- a/browse/browse.go +++ b/browse/browse.go @@ -1,6 +1,7 @@ package browse import ( + "errors" "net/http" "strings" @@ -21,6 +22,6 @@ func ServeHTTP(w http.ResponseWriter, r *http.Request, c *config.Config) (int, e case "GET": return GET(w, r, c) default: - return 400, nil + return 400, errors.New("Invalid method.") } } diff --git a/editor/editor.go b/editor/editor.go index 40ad2e61..03c958df 100644 --- a/editor/editor.go +++ b/editor/editor.go @@ -1,6 +1,7 @@ package editor import ( + "errors" "net/http" "strings" @@ -18,6 +19,6 @@ func ServeHTTP(w http.ResponseWriter, r *http.Request, c *config.Config) (int, e case "GET": return GET(w, r, c, filename) default: - return 400, nil + return 400, errors.New("Invalid method.") } } diff --git a/editor/post.go b/editor/post.go index 83c0590c..5d8b2967 100644 --- a/editor/post.go +++ b/editor/post.go @@ -81,7 +81,7 @@ func parseFrontMatterOnlyFile(rawFile map[string]interface{}, filename string) ( case "yaml": mark = rune('-') default: - return []byte{}, http.StatusBadRequest, errors.New("can't define the frontmatter") + return []byte{}, http.StatusBadRequest, errors.New("Can't define the frontmatter.") } f, err := parser.InterfaceToFrontMatter(rawFile, mark)