-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
52 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package customerror | ||
|
||
// ApplicationError はアプリケーション特有のエラー情報を保持する基本構造体です。 | ||
type ApplicationErrorCode struct { | ||
// StatusCode(JSON parseでは構造体省略) | ||
Status int `json:"-"` | ||
// Code はエラーコードを表します。 | ||
Code string `json:"code"` | ||
// Message はエラーメッセージを表します。 | ||
Message string `json:"message"` | ||
} | ||
|
||
var ( | ||
WrongEmailVerificationCode ApplicationErrorCode = ApplicationErrorCode{ | ||
Code: "WRONG_EMAIL_VERIFICATION_ERROR", | ||
Message: "Wrong email verification code", | ||
} | ||
|
||
// Unknown Error: システムがエラーの原因を特定できないか、エラーの種類が分類されていない場合に使用する。 | ||
UnknownCode ApplicationErrorCode = ApplicationErrorCode{ | ||
Code: "unknown_error", | ||
Message: "unknown_error", | ||
} | ||
|
||
UnexpectedCode ApplicationErrorCode = ApplicationErrorCode{ | ||
Code: "unexpected_error", | ||
Message: "unexpected_error", | ||
} | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters