@@ -355,14 +355,16 @@ func collectInstancesFromAppDir(appDir string, selectedInstName string) (
355
355
356
356
if instance .Configuration , err = loadInstanceConfig (instance .ClusterConfigPath ,
357
357
instance .InstName ); err != nil {
358
- return instances , err
358
+ return instances , fmt .Errorf ("error loading instance %q configuration from " +
359
+ "config %q: %w" , instance .InstName , instance .ClusterConfigPath , err )
359
360
}
360
361
361
362
instance .AppName = filepath .Base (appDir )
362
363
instance .SingleApp = false
363
364
if instance .InstanceScript , err = findInstanceScriptInAppDir (appDir , instance .InstName ,
364
365
appDirFiles .clusterCfgPath , appDirFiles .defaultLuaPath ); err != nil {
365
- return instances , err
366
+ return instances , fmt .Errorf ("cannot find instance script for %q in config %q: %w " ,
367
+ instance .InstName , appDirFiles .clusterCfgPath , err )
366
368
}
367
369
instances = append (instances , instance )
368
370
}
@@ -542,7 +544,7 @@ func CollectInstancesForApps(appList []util.AppListEntry, cliOpts *config.CliOpt
542
544
appName := strings .TrimSuffix (appInfo .Name , ".lua" )
543
545
collectedInstances , err := CollectInstances (appName , instEnabledPath )
544
546
if err != nil {
545
- return instances , fmt .Errorf ("%s: can't find an application init file : %s " ,
547
+ return instances , fmt .Errorf ("can't collect instance information for %s : %w " ,
546
548
appName , err )
547
549
}
548
550
@@ -665,7 +667,6 @@ func Run(runOpts *RunOpts, scriptPath string) error {
665
667
return err
666
668
}
667
669
668
- // Status returns the status of the Instance.
669
670
func Status (run * InstanceCtx ) process_utils.ProcessState {
670
671
return process_utils .ProcessStatus (run .PIDFile )
671
672
}
0 commit comments