Skip to content

Commit d78afff

Browse files
authored
Merge pull request #27 from database-playground/clean-up-error-code
refactor: remove unused error code and document other codes
2 parents ba24a83 + cc382e0 commit d78afff

File tree

2 files changed

+4
-10
lines changed

2 files changed

+4
-10
lines changed

graph/defs/README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,7 @@
55
## 錯誤碼
66

77
- `NOT_FOUND`:找不到指定的實體。
8-
- `UNAUTHORIZED`:這個 API 需要認證或授權後才能運作。如果權限 (scope) 不足也會顯示這個錯誤。
9-
- `USER_VERIFIED`:使用者已經驗證過,不用重複驗證。目前只用於 `verifyRegistration` mutation。
8+
- `UNAUTHORIZED`:這個 API 需要認證或授權後才能運作。
9+
- `NOT_IMPLEMENTED`:這個 API 尚未實作,請先不要呼叫。
10+
- `FORBIDDEN`:使用者的權限 (scope) 不足以執行這個操作。
11+
- `INVALID_INPUT`:輸入有誤。

graph/defs/errors.go

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,6 @@ var ErrForbidden = GqlError{
4040
Code: CodeForbidden,
4141
}
4242

43-
// ErrVerified is the error for "user already verified".
44-
var ErrVerified = GqlError{
45-
Message: "user already verified",
46-
Code: CodeUserVerified,
47-
}
48-
4943
// ErrNotImplemented is the error for "not implemented".
5044
var ErrNotImplemented = GqlError{
5145
Message: "not implemented",
@@ -67,8 +61,6 @@ const (
6761
CodeNotFound = "NOT_FOUND"
6862
// CodeUnauthorized is the error code for "require authentication".
6963
CodeUnauthorized = "UNAUTHORIZED"
70-
// CodeUserVerified is the error code for "user already verified".
71-
CodeUserVerified = "USER_VERIFIED"
7264
// CodeNotImplemented is the error code for "not implemented".
7365
CodeNotImplemented = "NOT_IMPLEMENTED"
7466
// CodeForbidden is the error code for "forbidden".

0 commit comments

Comments
 (0)