errors.go 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. package remotecontext
  2. type notFoundError string
  3. func (e notFoundError) Error() string {
  4. return string(e)
  5. }
  6. func (notFoundError) NotFound() {}
  7. type requestError string
  8. func (e requestError) Error() string {
  9. return string(e)
  10. }
  11. func (e requestError) InvalidParameter() {}
  12. type unauthorizedError string
  13. func (e unauthorizedError) Error() string {
  14. return string(e)
  15. }
  16. func (unauthorizedError) Unauthorized() {}
  17. type forbiddenError string
  18. func (e forbiddenError) Error() string {
  19. return string(e)
  20. }
  21. func (forbiddenError) Forbidden() {}
  22. type dnsError struct {
  23. cause error
  24. }
  25. func (e dnsError) Error() string {
  26. return e.cause.Error()
  27. }
  28. func (e dnsError) NotFound() {}
  29. func (e dnsError) Cause() error {
  30. return e.cause
  31. }
  32. type systemError struct {
  33. cause error
  34. }
  35. func (e systemError) Error() string {
  36. return e.cause.Error()
  37. }
  38. func (e systemError) SystemError() {}
  39. func (e systemError) Cause() error {
  40. return e.cause
  41. }
  42. type unknownError struct {
  43. cause error
  44. }
  45. func (e unknownError) Error() string {
  46. return e.cause.Error()
  47. }
  48. func (unknownError) Unknown() {}
  49. func (e unknownError) Cause() error {
  50. return e.cause
  51. }