From 8d040c966f777a3fc462d0fb24775cb865519991 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bj=C3=B8rn=20Erik=20Pedersen?= Date: Tue, 13 Sep 2016 19:11:36 +0200 Subject: [PATCH] commands: Improve error messages in convert See #2440 --- commands/convert.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/commands/convert.go b/commands/convert.go index b9aa7b8f..da821781 100644 --- a/commands/convert.go +++ b/commands/convert.go @@ -137,17 +137,17 @@ func convertContents(mark rune) (err error) { page.SetDir(filepath.Join(helpers.AbsPathify(viper.GetString("ContentDir")), file.Dir())) page.SetSourceContent(psr.Content()) if err = page.SetSourceMetaData(metadata, mark); err != nil { - return err + return fmt.Errorf("Failed to set source metadata for file %q: %s", page.FullFilePath(), err) } if outputDir != "" { if err = page.SaveSourceAs(filepath.Join(outputDir, page.FullFilePath())); err != nil { - return err + return fmt.Errorf("Failed to save file %q: %s", page.FullFilePath(), err) } } else { if unsafe { if err = page.SaveSource(); err != nil { - return err + return fmt.Errorf("Failed to save file %q: %s", page.FullFilePath(), err) } } else { jww.FEEDBACK.Println("Unsafe operation not allowed, use --unsafe or set a different output path") -- 2.30.2