add error codes

This commit is contained in:
AJ ONeal 2020-09-17 07:59:38 +00:00
부모 84e1863da2
커밋 c36c0200f3
1개의 변경된 파일2개의 추가작업 그리고 0개의 파일을 삭제

파일 보기

@ -153,6 +153,7 @@ func Route(jwksPrefix string, privkey keypairs.PrivateKey) http.Handler {
http.Error(w, "Bad Request", http.StatusBadRequest)
b, _ := json.Marshal(&HTTPResponse{
Error: "missing require query parameter 'contact'",
Code: "E_USER",
})
w.Write(b)
return
@ -253,6 +254,7 @@ func Route(jwksPrefix string, privkey keypairs.PrivateKey) http.Handler {
if errTokenNotVerified == err {
b, _ := json.Marshal(&HTTPResponse{
Error: err.Error(),
Code: "E_RETRY",
})
w.Write(b)
return