adjust errors and logger

This commit is contained in:
Shen Junzheng
2025-04-01 13:09:59 +08:00
parent f31953c42b
commit 67c9623cea
49 changed files with 553 additions and 981 deletions

View File

@@ -2,9 +2,9 @@ package wechat
import (
"context"
"fmt"
"runtime"
"github.com/sjzar/chatlog/internal/errors"
"github.com/sjzar/chatlog/internal/wechat/model"
"github.com/sjzar/chatlog/internal/wechat/process"
)
@@ -87,7 +87,7 @@ func (m *Manager) GetAccount(name string) (*Account, error) {
func (m *Manager) GetProcess(name string) (*model.Process, error) {
p, ok := m.processMap[name]
if !ok {
return nil, fmt.Errorf("account not found: %s", name)
return nil, errors.WeChatAccountNotFound(name)
}
return p, nil
}