Refactor error handling in publisher.go, comment redundant logging in acl/follows.go, and improve error handling for connection rejections (403).

This commit is contained in:
2025-09-13 09:07:33 +01:00
parent fc546ddc0b
commit 8290e1ae0e
2 changed files with 16 additions and 7 deletions

View File

@@ -15,7 +15,7 @@ import (
"next.orly.dev/pkg/encoders/kind"
"next.orly.dev/pkg/interfaces/publisher"
"next.orly.dev/pkg/interfaces/typer"
utils "next.orly.dev/pkg/utils"
"next.orly.dev/pkg/utils"
)
const Type = "socketapi"
@@ -229,7 +229,7 @@ func (p *P) Deliver(ev *event.E) {
if err = d.w.Write(
writeCtx, websocket.MessageText, res.Marshal(nil),
); chk.E(err) {
); err != nil {
// On error, remove the subscriber connection safely
p.removeSubscriber(d.w)
_ = d.w.CloseNow()