Commit 8a5fe5b0 by bergquist

renderer: avoid calling Handle twice

parent 7a8a52a1
......@@ -31,11 +31,12 @@ func RenderToPng(c *middleware.Context) {
pngPath, err := renderer.RenderToPng(renderOpts)
if err != nil {
if err == renderer.ErrTimeout {
c.Handle(500, err.Error(), err)
}
if err != nil && err == renderer.ErrTimeout {
c.Handle(500, err.Error(), err)
return
}
if err != nil {
c.Handle(500, "Rendering failed.", err)
return
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment