feat: improved error messaging, and automatic doctor runs on fatal failure

This commit is contained in:
Lewis Wynne 2026-02-12 00:17:33 +00:00
parent 6ad6876051
commit d992074c9c
4 changed files with 39 additions and 9 deletions

View file

@ -23,6 +23,7 @@ THE SOFTWARE.
package cmd
import (
"fmt"
"os"
"github.com/spf13/cobra"
@ -40,7 +41,7 @@ func Execute() {
if configErr != nil {
cmd, _, _ := rootCmd.Find(os.Args[1:])
if !configSafeCmd(cmd) {
infof("Running pda! doctor")
printError(fmt.Errorf("fatal problem: running pda! doctor automatically"))
runDoctor(os.Stderr)
os.Exit(1)
}