aboutsummaryrefslogtreecommitdiff
path: root/hotline/panic.go
diff options
context:
space:
mode:
authorJeff Halter <868228+jhalter@users.noreply.github.com>2026-05-30 16:16:32 -0700
committerJeff Halter <868228+jhalter@users.noreply.github.com>2026-05-30 16:16:32 -0700
commit588dce918aeda0efc4db80b30525d28943c029cd (patch)
treec13a6b60e9a550f2b4b8aeb7ff3073a3ed6d6795 /hotline/panic.go
parent21cf5016d98ff568692e91751d021facbdfc6bb6 (diff)
Surface transaction handler errors instead of silently discarding them
Many handlers in internal/mobius/transaction_handlers.go returned an empty transaction slice on error (return res / return nil), so the client received no reply and the operation silently no-opped, with no log in most cases. Convert these silent discards across the file to a consistent convention: log the underlying cause via cc.Logger.Error and return cc.NewErrReply with a user-facing message. Covers the file-operation, file-transfer, news, user/account, and chat handler groups. Genuinely intentional no-reply paths (target user offline, banned-nickname disconnect) are kept silent but now carry an explanatory comment. Also fixes adjacent defects found along the way: - HandleSetFileInfo: a non-IsNotExist error from os.Rename during a directory rename was swallowed; it now returns an error reply. - HandleUploadFile: when a resume is requested but no .incomplete file exists, fall back to a normal upload reply instead of discarding the reply. - hotline.DecodeNewsPath: previously panicked on a 1-byte client-supplied field (slice out of range) and silently produced empty path components on truncated input. It now validates length and framing and returns an error, which the handlers already surface. Adds regression tests for the new error replies, the upload resume fallback, and DecodeNewsPath's malformed-input handling.
Diffstat (limited to 'hotline/panic.go')
0 files changed, 0 insertions, 0 deletions