added error check

This commit is contained in:
Fabian Weber 2018-07-04 16:39:16 +02:00
parent 2c697c982b
commit 5998378773
1 changed files with 6 additions and 0 deletions

View File

@ -211,6 +211,12 @@ func AddNewKeyRequestHandler(w http.ResponseWriter, r *http.Request) {
}
keyOutput, err := Bech32KeyOutput(info)
if err != nil {
w.WriteHeader(http.StatusInternalServerError)
w.Write([]byte(err.Error()))
return
}
keyOutput.Seed = mnemonic
output, err := json.MarshalIndent(keyOutput, "", " ")