aboutsummaryrefslogtreecommitdiffstats
path: root/modules/markup/external/external.go
diff options
context:
space:
mode:
Diffstat (limited to 'modules/markup/external/external.go')
-rw-r--r--modules/markup/external/external.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/modules/markup/external/external.go b/modules/markup/external/external.go
index 23dd45ba0a..0eeb2d70a5 100644
--- a/modules/markup/external/external.go
+++ b/modules/markup/external/external.go
@@ -90,7 +90,7 @@ func (p *Renderer) Render(ctx *markup.RenderContext, input io.Reader, output io.
// write to temp file
f, err := os.CreateTemp("", "gitea_input")
if err != nil {
- return fmt.Errorf("%s create temp file when rendering %s failed: %v", p.Name(), p.Command, err)
+ return fmt.Errorf("%s create temp file when rendering %s failed: %w", p.Name(), p.Command, err)
}
tmpPath := f.Name()
defer func() {
@@ -102,12 +102,12 @@ func (p *Renderer) Render(ctx *markup.RenderContext, input io.Reader, output io.
_, err = io.Copy(f, input)
if err != nil {
f.Close()
- return fmt.Errorf("%s write data to temp file when rendering %s failed: %v", p.Name(), p.Command, err)
+ return fmt.Errorf("%s write data to temp file when rendering %s failed: %w", p.Name(), p.Command, err)
}
err = f.Close()
if err != nil {
- return fmt.Errorf("%s close temp file when rendering %s failed: %v", p.Name(), p.Command, err)
+ return fmt.Errorf("%s close temp file when rendering %s failed: %w", p.Name(), p.Command, err)
}
args = append(args, f.Name())
}
@@ -137,7 +137,7 @@ func (p *Renderer) Render(ctx *markup.RenderContext, input io.Reader, output io.
process.SetSysProcAttribute(cmd)
if err := cmd.Run(); err != nil {
- return fmt.Errorf("%s render run command %s %v failed: %v", p.Name(), commands[0], args, err)
+ return fmt.Errorf("%s render run command %s %v failed: %w", p.Name(), commands[0], args, err)
}
return nil
}