mirror of
https://github.com/status-im/go-waku.git
synced 2025-01-27 22:15:38 +00:00
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 {
|
||||
w.WriteHeader(http.StatusServiceUnavailable)
|
||||
_, err = w.Write([]byte(err.Error()))
|
||||
serv.log.Error("writing response", zap.Error(err))
|
||||
if err != nil {
|
||||
serv.log.Error("writing response", zap.Error(err))
|
||||
}
|
||||
} else {
|
||||
writeErrOrResponse(w, err, true)
|
||||
}
|
||||
|
@ -151,7 +151,6 @@ func (wakuLP *WakuLightPush) onRequest(ctx context.Context) func(network.Stream)
|
||||
wakuLP.metrics.RecordError(messagePushFailure)
|
||||
responseMsg := fmt.Sprintf("Could not publish message: %s", err.Error())
|
||||
responsePushRPC.Response.Info = &responseMsg
|
||||
return
|
||||
} else {
|
||||
responsePushRPC.Response.IsSuccess = true
|
||||
responseMsg := "OK"
|
||||
|
Loading…
x
Reference in New Issue
Block a user