Manager: allow setup to finish without Blender #104306
@ -265,11 +265,12 @@ func (f *Flamenco) SaveSetupAssistantConfig(e echo.Context) error {
|
|||||||
|
|
||||||
logger = logger.With().Interface("config", setupAssistantCfg).Logger()
|
logger = logger.With().Interface("config", setupAssistantCfg).Logger()
|
||||||
|
|
||||||
isConfigIncomplete := setupAssistantCfg.StorageLocation == "" ||
|
isConfigIncomplete := setupAssistantCfg.BlenderExecutable.Path == "" ||
|
||||||
!setupAssistantCfg.BlenderExecutable.IsUsable ||
|
setupAssistantCfg.BlenderExecutable.Input == ""
|
||||||
abelli marked this conversation as resolved
Outdated
|
|||||||
setupAssistantCfg.BlenderExecutable.Path == ""
|
|
||||||
|
|
||||||
abelli marked this conversation as resolved
Outdated
Sybren A. Stüvel
commented
It's fine to include the actual error message in the response as well, so that the caller knows what's wrong without checking the Manager log. It's fine to include the actual error message in the response as well, so that the caller knows what's wrong without checking the Manager log.
|
|||||||
if isConfigIncomplete && setupAssistantCfg.BlenderExecutable.Source != "default" {
|
if setupAssistantCfg.StorageLocation == "" ||
|
||||||
|
!setupAssistantCfg.BlenderExecutable.IsUsable ||
|
||||||
|
isConfigIncomplete && setupAssistantCfg.BlenderExecutable.Source != "default" {
|
||||||
logger.Warn().Msg("setup assistant: configuration is incomplete, unable to accept")
|
logger.Warn().Msg("setup assistant: configuration is incomplete, unable to accept")
|
||||||
return sendAPIError(e, http.StatusBadRequest, "configuration is incomplete")
|
return sendAPIError(e, http.StatusBadRequest, "configuration is incomplete")
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user
The work cannot be done, and so this should be logged as an error, not a warning.
I usually log errors as a 'cause' field:
Alternatively, if you want to keep the error message as part of the log message, you could use
.Msgf(...)
instead:%v
is Go's generic "put the thing's value here", and should result in the value oferr.Error()
.