Skip to content

Commit

Permalink
fix: add logs fro aggregate errors
Browse files Browse the repository at this point in the history
  • Loading branch information
elrrrrrrr committed Apr 17, 2024
1 parent abad15b commit 2d5bc6e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/core/service/PackageSyncerService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,9 @@ export class PackageSyncerService extends AbstractService {
logId = data.logId;
} catch (err: any) {
const status = err.status || 'unknow';
logs.push(`[${isoNow()}][UP] ❌ Sync ${fullname} fail, create sync task error: ${err}, status: ${status}`);
// 可能会抛出 AggregateError 异常
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/AggregateError
logs.push(`[${isoNow()}][UP] ❌ Sync ${fullname} fail, create sync task error: ${err}, status: ${status} ${err instanceof AggregateError ? err.errors : ''}`);
logs.push(`[${isoNow()}][UP] ${failEnd}`);
await this.taskService.appendTaskLog(task, logs.join('\n'));
return;
Expand Down

0 comments on commit 2d5bc6e

Please sign in to comment.