fix(i18n): Update log messages to English and improve error handling in bot initialization and storage loading

This commit is contained in:
krau
2025-12-19 20:29:48 +08:00
parent 6e16dc6051
commit 4ccbf8177e
5 changed files with 22 additions and 23 deletions

View File

@@ -47,12 +47,12 @@ var storageConstructors = map[storenum.StorageType]StorageConstructor{
func NewStorage(ctx context.Context, cfg storcfg.StorageConfig) (Storage, error) {
constructor, ok := storageConstructors[cfg.GetType()]
if !ok {
return nil, fmt.Errorf("不支持的存储类型: %s", cfg.GetType())
return nil, fmt.Errorf("unsupported storage type: %s", cfg.GetType())
}
storage := constructor()
if err := storage.Init(ctx, cfg); err != nil {
return nil, fmt.Errorf("初始化 %s 存储失败: %w", cfg.GetName(), err)
return nil, fmt.Errorf("failed to initialize storage %s: %w", cfg.GetName(), err)
}
return storage, nil