2
0

errors.go 583 B

12345678910111213141516171819202122
  1. package graphql
  2. import "gshopper.com/gshopify/customer/graphql/generated"
  3. var (
  4. ErrTokenNotExists = ErrToken("access token does not exist")
  5. ErrTokenExpired = ErrToken("access token has been expired")
  6. ErrToken = func(s string) *generated.UserError {
  7. return &generated.UserError{
  8. Field: []string{"customerAccessToken"},
  9. Message: s,
  10. }
  11. }
  12. )
  13. func CustomerError(code generated.CustomerErrorCode, err error, fields ...string) *generated.CustomerUserError {
  14. return &generated.CustomerUserError{
  15. Code: &code,
  16. Field: fields,
  17. Message: err.Error(),
  18. }
  19. }