mirror of
https://github.com/grafana/grafana.git
synced 2026-09-05 04:40:13 -05:00
enhance error message if phantomjs executable is not found
if arm build, explain that phantomjs is not included by default in arm builds. If not explain that phantom js isn't installed correctly
This commit is contained in:
@@ -3,7 +3,9 @@ package api
|
||||
import (
|
||||
"fmt"
|
||||
"net/http"
|
||||
"runtime"
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
m "github.com/grafana/grafana/pkg/models"
|
||||
@@ -55,6 +57,15 @@ func (hs *HTTPServer) RenderToPng(c *m.ReqContext) {
|
||||
return
|
||||
}
|
||||
|
||||
if err != nil && err == rendering.ErrPhantomJSNotInstalled {
|
||||
if strings.HasPrefix(runtime.GOARCH, "arm") {
|
||||
c.Handle(500, "Rendering failed - PhantomJS isn't included in arm build per default", err)
|
||||
} else {
|
||||
c.Handle(500, "Rendering failed - PhantomJS isn't installed correctly", err)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
if err != nil {
|
||||
c.Handle(500, "Rendering failed.", err)
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user