code touch-up for better maintainability

This commit is contained in:
2025-08-29 10:44:05 +09:00
parent f5a95505a9
commit 714748d8e2
4 changed files with 205 additions and 194 deletions

View File

@ -1102,7 +1102,7 @@ func (ctl *client_ctl_notices_id) ServeHTTP(w http.ResponseWriter, req *http.Req
// no check if noti.Text is empty as i want an empty message to be delivered too.
err = cts.psc.Send(MakeConnNoticePacket(noti.Text))
if err != nil {
err = fmt.Errorf("failed to send conn_notice text '%s' to %s - %s", noti.Text, cts.remote_addr, err.Error())
err = fmt.Errorf("failed to send %s text '%s' to %s - %s", PACKET_KIND_CONN_NOTICE.String(), noti.Text, cts.remote_addr, err.Error())
status_code = WriteJsonRespHeader(w, http.StatusInternalServerError)
je.Encode(JsonErrmsg{Text: err.Error()})
goto oops