Less dramatic logging when Blender cannot be found
Avoid the word "error" in logging when Blender cannot be found. Typically these are warnings, and having the word "error" there makes people think otherwise.
This commit is contained in:
parent
cb2042db71
commit
161a7f7cb3
@ -4,6 +4,7 @@ import (
|
||||
"context"
|
||||
"errors"
|
||||
"io/fs"
|
||||
"os/exec"
|
||||
"time"
|
||||
|
||||
"github.com/rs/zerolog/log"
|
||||
@ -35,7 +36,7 @@ func findBlender() {
|
||||
case errors.Is(err, fs.ErrNotExist):
|
||||
log.Warn().Msg("Blender could not be found, Flamenco Manager will have to supply a full path")
|
||||
case err != nil:
|
||||
log.Warn().Err(err).Msg("there was an unexpected error 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")
|
||||
default:
|
||||
log.Info().
|
||||
Str("path", result.FoundLocation).
|
||||
|
@ -60,7 +60,7 @@ func CheckBlender(ctx context.Context, exename string) (CheckBlenderResult, erro
|
||||
return CheckBlender(ctx, "blender")
|
||||
case err != nil:
|
||||
// Some other error occurred, better to report it.
|
||||
return CheckBlenderResult{}, fmt.Errorf("error finding .blend file association: %w", err)
|
||||
return CheckBlenderResult{}, fmt.Errorf("finding .blend file association: %w", err)
|
||||
default:
|
||||
// The full path was found, report the Blender version.
|
||||
return getResultWithVersion(ctx, exename, fullPath, api.BlenderPathSourceFileAssociation)
|
||||
|
@ -184,8 +184,8 @@ func (f *Flamenco) FindBlenderExePath(e echo.Context) error {
|
||||
case errors.Is(err, fs.ErrNotExist):
|
||||
logger.Info().Msg("Blender could not be found")
|
||||
case err != nil:
|
||||
logger.Warn().Err(err).Msg("there was an error finding Blender")
|
||||
return sendAPIError(e, http.StatusInternalServerError, "there was an error finding Blender: %v", err)
|
||||
logger.Warn().AnErr("cause", err).Msg("there was an issue finding Blender")
|
||||
return sendAPIError(e, http.StatusInternalServerError, "there was an issue finding Blender: %v", err)
|
||||
default:
|
||||
response = append(response, api.BlenderPathCheckResult{
|
||||
IsUsable: true,
|
||||
@ -203,7 +203,7 @@ func (f *Flamenco) FindBlenderExePath(e echo.Context) error {
|
||||
case errors.Is(err, fs.ErrNotExist), errors.Is(err, exec.ErrNotFound):
|
||||
logger.Debug().Msg("Blender could not be found as 'blender' on $PATH")
|
||||
case err != nil:
|
||||
logger.Info().Err(err).Msg("there was an error finding Blender as 'blender' on $PATH")
|
||||
logger.Info().AnErr("cause", err).Msg("there was an issue finding Blender as 'blender' on $PATH")
|
||||
default:
|
||||
response = append(response, api.BlenderPathCheckResult{
|
||||
IsUsable: true,
|
||||
|
Loading…
x
Reference in New Issue
Block a user