diff options
| author | Jeff Halter <868228+jhalter@users.noreply.github.com> | 2025-06-29 16:14:06 -0700 |
|---|---|---|
| committer | Jeff Halter <868228+jhalter@users.noreply.github.com> | 2025-06-29 16:14:06 -0700 |
| commit | 4a0c7c345c74f78ab0fda22f56c973c00bd50b7d (patch) | |
| tree | a5850f7a7b92d7ca5edd5a410aa7e35517e80c5c /hotline | |
| parent | 123567e1eb72a001ba15f05003db811024dcf917 (diff) | |
Extract hardcoded error strings into comprehensive public constants
Replace 60+ hardcoded error strings throughout transaction handlers with
public constants and templates for consistent error handling across the
Hotline protocol implementation.
Features:
- 33 authorization error constants (ErrMsgNotAllowed*)
- Account operation error constants (ErrMsgAccount*)
- File operation error templates with filename parameters (ErrMsgCannot*)
- Upload/download restriction templates (ErrMsgUpload*)
- Ban message constants (ErrMsgTemporaryBan, ErrMsgPermanentBan)
- General error constants (ErrMsgUserNotFound, ErrMsgCreateAlias)
- Chat/messaging templates (ErrMsgDoesNotAcceptTemplate)
Benefits:
- Single source of truth for all error messages
- Public API for other packages to import standard error constants
- Sprintf-style templates for dynamic content (filenames, usernames)
- Clear distinction between protocol errors (ErrMsg*) and golang errors
- Improved maintainability and consistency across transaction handlers
All error messages are now centralized, making future modifications
easier and ensuring consistent user experience across all operations.
Diffstat (limited to 'hotline')
0 files changed, 0 insertions, 0 deletions