add error codes
This commit is contained in:
parent
84e1863da2
commit
c36c0200f3
|
@ -153,6 +153,7 @@ func Route(jwksPrefix string, privkey keypairs.PrivateKey) http.Handler {
|
||||||
http.Error(w, "Bad Request", http.StatusBadRequest)
|
http.Error(w, "Bad Request", http.StatusBadRequest)
|
||||||
b, _ := json.Marshal(&HTTPResponse{
|
b, _ := json.Marshal(&HTTPResponse{
|
||||||
Error: "missing require query parameter 'contact'",
|
Error: "missing require query parameter 'contact'",
|
||||||
|
Code: "E_USER",
|
||||||
})
|
})
|
||||||
w.Write(b)
|
w.Write(b)
|
||||||
return
|
return
|
||||||
|
@ -253,6 +254,7 @@ func Route(jwksPrefix string, privkey keypairs.PrivateKey) http.Handler {
|
||||||
if errTokenNotVerified == err {
|
if errTokenNotVerified == err {
|
||||||
b, _ := json.Marshal(&HTTPResponse{
|
b, _ := json.Marshal(&HTTPResponse{
|
||||||
Error: err.Error(),
|
Error: err.Error(),
|
||||||
|
Code: "E_RETRY",
|
||||||
})
|
})
|
||||||
w.Write(b)
|
w.Write(b)
|
||||||
return
|
return
|
||||||
|
|
Loading…
Reference in New Issue