Skip to content

Commit

Permalink
condense error info
Browse files Browse the repository at this point in the history
  • Loading branch information
warriordog committed Oct 8, 2024
1 parent b4d10aa commit f62cd89
Showing 1 changed file with 11 additions and 14 deletions.
25 changes: 11 additions & 14 deletions packages/backend/src/queue/QueueProcessorService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,29 +127,26 @@ export class QueueProcessorService implements OnApplicationShutdown {
this.logger = this.queueLoggerService.logger;

function renderError(e?: Error) {
// 何故かeがundefinedで来ることがある
if (!e) return '?';

if (e instanceof Bull.UnrecoverableError) {
return {
stack: undefined,
message: e.message,
name: 'Bull.UnrecoverableError',
};
} else if (e) { // 何故かeがundefinedで来ることがある
return {
stack: e.stack,
message: e.message,
name: e.name,
};
} else {
return {
stack: '?',
message: '?',
name: '?',
};
}

return {
stack: e.stack,
message: e.message,
name: e.name,
};
}

function renderJob(job?: Bull.Job) {
if (!job) return 'N/A';
if (!job) return '?';

return {
name: job.name,
info: getJobInfo(job),
Expand Down

0 comments on commit f62cd89

Please sign in to comment.