errors.go 634 B

12345678910111213141516171819202122232425262728293031
  1. package download
  2. import (
  3. "fmt"
  4. "github.com/leonelquinteros/gotext"
  5. )
  6. // ErrAURPackageNotFound means that package was not found in AUR.
  7. type ErrAURPackageNotFound struct {
  8. pkgName string
  9. }
  10. func (e ErrAURPackageNotFound) Error() string {
  11. return fmt.Sprintln(gotext.Get("package not found in AUR"), ":", e.pkgName)
  12. }
  13. type ErrGetPKGBUILDRepo struct {
  14. inner error
  15. pkgName string
  16. errOut string
  17. }
  18. func (e ErrGetPKGBUILDRepo) Error() string {
  19. return fmt.Sprintln(gotext.Get("error fetching %s: %s", e.pkgName, e.errOut),
  20. "\n\t context:", e.inner.Error())
  21. }
  22. func (e *ErrGetPKGBUILDRepo) Unwrap() error {
  23. return e.inner
  24. }