Skip to content

Commit

Permalink
Added more error handling messages
Browse files Browse the repository at this point in the history
  • Loading branch information
samtholiya committed Jan 15, 2025
1 parent 2d58541 commit c49448d
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion internal/exec/vendor_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,16 @@ func ReadAndProcessVendorConfigFile(
// Check if it's a directory
fileInfo, err := os.Stat(foundVendorConfigFile)
if err != nil {
return vendorConfig, false, "", fmt.Errorf("Vendoring is not configured. To set up vendoring please see https://atmos.tools/core-concepts/vendor/")
if os.IsNotExist(err) {
// File does not exist
return vendorConfig, false, "", fmt.Errorf("Vendoring is not configured. To set up vendoring, please see https://atmos.tools/core-concepts/vendor/")
}
if os.IsPermission(err) {
// Permission error
return vendorConfig, false, "", fmt.Errorf("Permission denied when accessing '%s'. Please check the file permissions.", foundVendorConfigFile)
}
// Other errors
return vendorConfig, false, "", fmt.Errorf("An error occurred while accessing the vendoring configuration: %w", err)
}

var configFiles []string
Expand Down

0 comments on commit c49448d

Please sign in to comment.