errors.go 700 B

12345678910111213141516171819202122232425262728293031323334
  1. package main
  2. import "github.com/leonelquinteros/gotext"
  3. type SetPkgReasonError struct {
  4. exp bool // explicit
  5. }
  6. func (e *SetPkgReasonError) Error() string {
  7. reason := gotext.Get("explicit")
  8. if !e.exp {
  9. reason = gotext.Get("dependency")
  10. }
  11. return gotext.Get("error updating package install reason to %s", reason)
  12. }
  13. type FindPkgDestError struct {
  14. name, pkgDest string
  15. }
  16. func (e *FindPkgDestError) Error() string {
  17. return gotext.Get(
  18. "the PKGDEST for %s is listed by makepkg but does not exist: %s",
  19. e.name, e.pkgDest)
  20. }
  21. type PkgDestNotInListError struct {
  22. name string
  23. }
  24. func (e *PkgDestNotInListError) Error() string {
  25. return gotext.Get("could not find PKGDEST for: %s", e.name)
  26. }