Wrap error message when finding Blender via file association fails

This commit is contained in:
Sybren A. Stüvel 2022-07-14 18:49:37 +02:00
parent 72337c55cd
commit c0f4657be4

View File

@ -5,6 +5,7 @@ package find_blender
import ( import (
"context" "context"
"errors" "errors"
"fmt"
"os/exec" "os/exec"
"strings" "strings"
@ -39,7 +40,7 @@ func CheckBlender(ctx context.Context, exename string) (CheckBlenderResult, erro
return CheckBlender(ctx, "blender") return CheckBlender(ctx, "blender")
case err != nil: case err != nil:
// Some other error occurred, better to report it. // Some other error occurred, better to report it.
return CheckBlenderResult{}, err return CheckBlenderResult{}, fmt.Errorf("error finding .blend file association: %w", err)
default: default:
// The full path was found, report the Blender version. // The full path was found, report the Blender version.
return getResultWithVersion(ctx, exename, fullPath, api.BlenderPathSourceFileAssociation) return getResultWithVersion(ctx, exename, fullPath, api.BlenderPathSourceFileAssociation)