From 04089c533bd2dac7970cae2e6202a83c3e13b802 Mon Sep 17 00:00:00 2001 From: Tobias Weingartner Date: Sat, 30 Apr 2016 17:04:44 -0700 Subject: [PATCH] Return errors. --- middleware/markdown/process.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/middleware/markdown/process.go b/middleware/markdown/process.go index 15e5e7ca..1dd468d3 100644 --- a/middleware/markdown/process.go +++ b/middleware/markdown/process.go @@ -16,19 +16,19 @@ type FileInfo struct { ctx middleware.Context } -func (f FileInfo) Summarize(wordcount int) string { +func (f FileInfo) Summarize(wordcount int) (string, error) { fp, err := f.ctx.Root.Open(f.Name()) if err != nil { - return "" + return "", err } defer fp.Close() buf, err := ioutil.ReadAll(fp) if err != nil { - return "" + return "", err } - return string(summary.Markdown(buf, wordcount)) + return string(summary.Markdown(buf, wordcount)), nil } // Markdown processes the contents of a page in b. It parses the metadata