Skip to content

Commit

Permalink
Merge pull request #480 from thematters/enhancement/sync-error
Browse files Browse the repository at this point in the history
Sync with backend: remove "USER_FOLLOW_FAILED", add "ACTION_FAILED"
  • Loading branch information
robertu7 authored Oct 24, 2019
2 parents 416adf5 + 433b3d8 commit 58e22d1
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
3 changes: 2 additions & 1 deletion src/common/enums/errorCode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ export const ERROR_CODES = {
NETWORK_ERROR: 'NETWORK_ERROR',
INTERNAL_SERVER_ERROR: 'INTERNAL_SERVER_ERROR',
BAD_USER_INPUT: 'BAD_USER_INPUT',

ACTION_LIMIT_EXCEEDED: 'ACTION_LIMIT_EXCEEDED',
ACTION_FAILED: 'ACTION_FAILED',

// Auth
UNAUTHENTICATED: 'UNAUTHENTICATED',
Expand Down Expand Up @@ -34,7 +36,6 @@ export const ERROR_CODES = {
USER_USERNAME_INVALID: 'USER_USERNAME_INVALID',
USER_USERNAME_EXISTS: 'USER_USERNAME_EXISTS',
USER_DISPLAYNAME_INVALID: 'USER_DISPLAYNAME_INVALID',
USER_FOLLOW_FAILED: 'USER_FOLLOW_FAILED',

// Verification Code
CODE_INVALID: 'CODE_INVALID',
Expand Down
4 changes: 2 additions & 2 deletions src/common/enums/text.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ export const TEXT = {
USER_USERNAME_INVALID: 'Matters ID 不正確',
USER_USERNAME_EXISTS: '該 Matters ID 已被其他使用者使用',
USER_DISPLAYNAME_INVALID: '姓名不正確',
USER_FOLLOW_FAILED: '追蹤用戶失敗,請稍候重試',
ACTION_FAILED: '操作失敗,請稍候重試',
CODE_INVALID: '驗證碼不正確',
CODE_EXPIRED: '驗證碼已過期'
} as { [key: string]: string }
Expand Down Expand Up @@ -329,7 +329,7 @@ export const TEXT = {
USER_USERNAME_INVALID: 'Matters ID 不正确',
USER_USERNAME_EXISTS: '该 Matters ID 已被其他用户使用',
USER_DISPLAYNAME_INVALID: '姓名不正确',
USER_FOLLOW_FAILED: '追踪用户失败,请稍候重试',
ACTION_FAILED: '操作失败,请稍候重试',
CODE_INVALID: '验证码不正确',
CODE_EXPIRED: '验证码已过期'
} as { [key: string]: string }
Expand Down
3 changes: 2 additions & 1 deletion src/components/GQL/error.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,8 @@ export const mutationOnError = (error: ApolloError) => {
ERROR_CODES.DRAFT_NOT_FOUND,
ERROR_CODES.TAG_NOT_FOUND,
ERROR_CODES.NOTICE_NOT_FOUND,
ERROR_CODES.NOT_ENOUGH_MAT
ERROR_CODES.NOT_ENOUGH_MAT,
ERROR_CODES.ACTION_FAILED
]
CATCH_CODES.forEach(code => {
if (errorMap[code]) {
Expand Down

0 comments on commit 58e22d1

Please sign in to comment.