mirror of
https://github.com/long2icc/sonicnote-sync.git
synced 2026-07-22 07:45:14 +00:00
fix: 增加错误处理日志以便调试同步和请求失败问题
This commit is contained in:
parent
99ae04dad6
commit
fed8a18cb7
3 changed files with 5 additions and 1 deletions
BIN
release/sonicnote-sync-v1.1.6.zip
Normal file
BIN
release/sonicnote-sync-v1.1.6.zip
Normal file
Binary file not shown.
|
|
@ -48,6 +48,7 @@ export class SonicNoteApiClient {
|
|||
if (e?.json) {
|
||||
return e.json as BackendResponse;
|
||||
}
|
||||
console.error(`[SonicNote] 请求失败 ${method} ${path}:`, e?.message || e);
|
||||
throw new Error(e?.message || `请求失败: ${method} ${path}`);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -46,6 +46,7 @@ export class SyncService {
|
|||
} catch (e) {
|
||||
const msg = e instanceof Error ? e.message : '获取录音列表失败';
|
||||
result.errorMessages.push(msg);
|
||||
console.error('[SonicNote] 获取录音列表失败:', e);
|
||||
new Notice(`同步失败: ${msg}`);
|
||||
return result;
|
||||
}
|
||||
|
|
@ -66,7 +67,9 @@ export class SyncService {
|
|||
} catch (e) {
|
||||
result.errors++;
|
||||
const msg = e instanceof Error ? e.message : '未知错误';
|
||||
result.errorMessages.push(`${recording.recordNickName || recording.recordName}: ${msg}`);
|
||||
const name = recording.recordNickName || recording.recordName;
|
||||
result.errorMessages.push(`${name}: ${msg}`);
|
||||
console.error(`[SonicNote] 同步失败 — ${name} (${recording.audioId}):`, e);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue