refactor: improve error handling in getSelectStorageMarkup for user retrieval

This commit is contained in:
krau
2025-02-20 22:53:08 +08:00
parent cbc2dc82d8
commit 5c8261c34a

View File

@@ -46,7 +46,7 @@ var storageHashName = map[string]string{}
func getSelectStorageMarkup(userChatID int64, fileChatID, fileMessageID int) (*tg.ReplyInlineMarkup, error) {
user, err := dao.GetUserByChatID(userChatID)
if err != nil {
return nil, err
return nil, fmt.Errorf("failed to get user by chat ID: %d, error: %w", userChatID, err)
}
storages := storage.GetUserStorages(user.ChatID)
if len(storages) == 0 {