2025-06-09 17:37:08 +05:30
|
|
|
package packagemanager
|
|
|
|
|
|
|
|
|
|
import (
|
2026-05-24 12:22:19 +05:30
|
|
|
"github.com/safedep/dry/usefulerror"
|
|
|
|
|
"github.com/safedep/pmg/errcodes"
|
2025-06-09 17:37:08 +05:30
|
|
|
)
|
|
|
|
|
|
|
|
|
|
var (
|
2026-05-24 12:22:19 +05:30
|
|
|
ErrFailedToResolveVersion = usefulerror.NewUsefulError().
|
|
|
|
|
WithCode(errcodes.Network).
|
2025-08-21 18:26:05 +05:30
|
|
|
WithHumanError("Failed to resolve the requested package version.").
|
2026-01-18 16:00:37 +05:30
|
|
|
WithHelp("Check your network connection and try again.").
|
2026-05-24 12:22:19 +05:30
|
|
|
WithMsg("failed to resolve package version")
|
2025-08-21 18:26:05 +05:30
|
|
|
|
2026-05-24 12:22:19 +05:30
|
|
|
ErrFailedToParsePackage = usefulerror.NewUsefulError().
|
2026-05-24 12:46:06 +05:30
|
|
|
WithCode(errcodes.PackageParseFailed).
|
2025-08-21 18:26:05 +05:30
|
|
|
WithHumanError("The package data could not be processed.").
|
|
|
|
|
WithHelp("The package may be corrupted or in an unsupported format.").
|
2026-05-24 12:22:19 +05:30
|
|
|
WithMsg("failed to parse package")
|
2025-08-21 18:26:05 +05:30
|
|
|
|
2026-05-24 12:22:19 +05:30
|
|
|
ErrAuthorNotFound = usefulerror.NewUsefulError().
|
2026-05-24 12:46:06 +05:30
|
|
|
WithCode(errcodes.PackageAuthorNotFound).
|
2025-08-21 18:26:05 +05:30
|
|
|
WithHumanError("The package author information could not be found.").
|
|
|
|
|
WithHelp("This may be due to incomplete package metadata or network issues.").
|
2026-05-24 12:22:19 +05:30
|
|
|
WithMsg("author not found")
|
2025-08-21 18:26:05 +05:30
|
|
|
|
2026-05-24 12:22:19 +05:30
|
|
|
ErrGitHubRateLimitExceeded = usefulerror.NewUsefulError().
|
2026-05-24 12:46:06 +05:30
|
|
|
WithCode(errcodes.GitHubRateLimitExceeded).
|
2025-08-21 18:26:05 +05:30
|
|
|
WithHumanError("GitHub API rate limit has been exceeded.").
|
|
|
|
|
WithHelp("Wait for the rate limit to reset or configure authentication to increase your rate limit.").
|
2026-05-24 12:22:19 +05:30
|
|
|
WithMsg("github api rate limit exceeded")
|
2025-06-09 17:37:08 +05:30
|
|
|
)
|