mirror of https://github.com/status-im/go-waku.git
fix(lightpush): no response on err (#1083)
This commit is contained in:
parent
0260cfe954
commit
714a310462
|
@ -73,7 +73,9 @@ func (serv *LightpushService) postMessagev1(w http.ResponseWriter, req *http.Req
|
||||||
if err != nil {
|
if err != nil {
|
||||||
w.WriteHeader(http.StatusServiceUnavailable)
|
w.WriteHeader(http.StatusServiceUnavailable)
|
||||||
_, err = w.Write([]byte(err.Error()))
|
_, err = w.Write([]byte(err.Error()))
|
||||||
|
if err != nil {
|
||||||
serv.log.Error("writing response", zap.Error(err))
|
serv.log.Error("writing response", zap.Error(err))
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
writeErrOrResponse(w, err, true)
|
writeErrOrResponse(w, err, true)
|
||||||
}
|
}
|
||||||
|
|
|
@ -151,7 +151,6 @@ func (wakuLP *WakuLightPush) onRequest(ctx context.Context) func(network.Stream)
|
||||||
wakuLP.metrics.RecordError(messagePushFailure)
|
wakuLP.metrics.RecordError(messagePushFailure)
|
||||||
responseMsg := fmt.Sprintf("Could not publish message: %s", err.Error())
|
responseMsg := fmt.Sprintf("Could not publish message: %s", err.Error())
|
||||||
responsePushRPC.Response.Info = &responseMsg
|
responsePushRPC.Response.Info = &responseMsg
|
||||||
return
|
|
||||||
} else {
|
} else {
|
||||||
responsePushRPC.Response.IsSuccess = true
|
responsePushRPC.Response.IsSuccess = true
|
||||||
responseMsg := "OK"
|
responseMsg := "OK"
|
||||||
|
|
Loading…
Reference in New Issue