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:
Marcus Efraimsson
2018-06-25 16:06:52 +02:00
parent 132df4553c
commit f106de0efd
3 changed files with 17 additions and 0 deletions
+5
View File
@@ -24,6 +24,11 @@ func (rs *RenderingService) renderViaPhantomJS(ctx context.Context, opts Opts) (
url := rs.getURL(opts.Path)
binPath, _ := filepath.Abs(filepath.Join(rs.Cfg.PhantomDir, executable))
if _, err := os.Stat(binPath); os.IsNotExist(err) {
rs.log.Error("executable not found", "executable", binPath)
return nil, ErrPhantomJSNotInstalled
}
scriptPath, _ := filepath.Abs(filepath.Join(rs.Cfg.PhantomDir, "render.js"))
pngPath := rs.getFilePathForNewImage()