Blender finder: also handle exec.ErrNotFound as "expected"

Blender not being found can be reported via various errors (this should be
reworked in the 'blender finder API' at some point). `exec.ErrNotFound` is
returned when Blender cannot be found on `$PATH`, which is something that's
absolutely fine. This is now logged less dramatically.
This commit is contained in:
Sybren A. Stüvel 2022-09-22 12:39:40 +02:00
parent 161a7f7cb3
commit 759a94e49b
2 changed files with 2 additions and 2 deletions

View File

@ -33,7 +33,7 @@ func findBlender() {
result, err := find_blender.Find(ctx) result, err := find_blender.Find(ctx)
switch { switch {
case errors.Is(err, fs.ErrNotExist): case errors.Is(err, fs.ErrNotExist), errors.Is(err, exec.ErrNotFound):
log.Warn().Msg("Blender could not be found, Flamenco Manager will have to supply a full path") log.Warn().Msg("Blender could not be found, Flamenco Manager will have to supply a full path")
case err != nil: case err != nil:
log.Warn().AnErr("cause", err).Msg("there was an issue finding Blender on this system, Flamenco Manager will have to supply a full path") log.Warn().AnErr("cause", err).Msg("there was an issue finding Blender on this system, Flamenco Manager will have to supply a full path")

View File

@ -181,7 +181,7 @@ func (f *Flamenco) FindBlenderExePath(e echo.Context) error {
// executable and reports on the version of Blender. // executable and reports on the version of Blender.
result, err := find_blender.CheckBlender(ctx, "") result, err := find_blender.CheckBlender(ctx, "")
switch { switch {
case errors.Is(err, fs.ErrNotExist): case errors.Is(err, fs.ErrNotExist), errors.Is(err, exec.ErrNotFound):
logger.Info().Msg("Blender could not be found") logger.Info().Msg("Blender could not be found")
case err != nil: case err != nil:
logger.Warn().AnErr("cause", err).Msg("there was an issue finding Blender") logger.Warn().AnErr("cause", err).Msg("there was an issue finding Blender")