mirror of
https://codeberg.org/yeentown/barkey
synced 2024-11-25 10:35:12 +00:00
condense error info
This commit is contained in:
parent
b4d10aa8f8
commit
f62cd8941c
1 changed files with 11 additions and 14 deletions
|
@ -127,29 +127,26 @@ export class QueueProcessorService implements OnApplicationShutdown {
|
||||||
this.logger = this.queueLoggerService.logger;
|
this.logger = this.queueLoggerService.logger;
|
||||||
|
|
||||||
function renderError(e?: Error) {
|
function renderError(e?: Error) {
|
||||||
|
// 何故かeがundefinedで来ることがある
|
||||||
|
if (!e) return '?';
|
||||||
|
|
||||||
if (e instanceof Bull.UnrecoverableError) {
|
if (e instanceof Bull.UnrecoverableError) {
|
||||||
return {
|
return {
|
||||||
stack: undefined,
|
|
||||||
message: e.message,
|
message: e.message,
|
||||||
name: 'Bull.UnrecoverableError',
|
name: 'Bull.UnrecoverableError',
|
||||||
};
|
};
|
||||||
} else if (e) { // 何故かeがundefinedで来ることがある
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
stack: e.stack,
|
stack: e.stack,
|
||||||
message: e.message,
|
message: e.message,
|
||||||
name: e.name,
|
name: e.name,
|
||||||
};
|
};
|
||||||
} else {
|
|
||||||
return {
|
|
||||||
stack: '?',
|
|
||||||
message: '?',
|
|
||||||
name: '?',
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function renderJob(job?: Bull.Job) {
|
function renderJob(job?: Bull.Job) {
|
||||||
if (!job) return 'N/A';
|
if (!job) return '?';
|
||||||
|
|
||||||
return {
|
return {
|
||||||
name: job.name,
|
name: job.name,
|
||||||
info: getJobInfo(job),
|
info: getJobInfo(job),
|
||||||
|
|
Loading…
Reference in a new issue