diff options
| author | Hazelnoot <acomputerdog@gmail.com> | 2025-03-03 01:03:21 -0500 |
|---|---|---|
| committer | Hazelnoot <acomputerdog@gmail.com> | 2025-06-06 22:19:50 -0400 |
| commit | 61d0aeba2ec3590ddea08987b1f834e0d79e9fa0 (patch) | |
| tree | 4ff8c2e94c2087ccb18b93730070ffeada156cc5 /packages/backend/src/queue/QueueProcessorService.ts | |
| parent | improve retryable error detection in ApPersonService.ts (diff) | |
| download | sharkey-61d0aeba2ec3590ddea08987b1f834e0d79e9fa0.tar.gz sharkey-61d0aeba2ec3590ddea08987b1f834e0d79e9fa0.tar.bz2 sharkey-61d0aeba2ec3590ddea08987b1f834e0d79e9fa0.zip | |
add renderInlineError to serialize errors in a consistent way
Diffstat (limited to 'packages/backend/src/queue/QueueProcessorService.ts')
| -rw-r--r-- | packages/backend/src/queue/QueueProcessorService.ts | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/packages/backend/src/queue/QueueProcessorService.ts b/packages/backend/src/queue/QueueProcessorService.ts index de74b883d5..341469e4e2 100644 --- a/packages/backend/src/queue/QueueProcessorService.ts +++ b/packages/backend/src/queue/QueueProcessorService.ts @@ -14,6 +14,7 @@ import { bindThis } from '@/decorators.js'; import { CheckModeratorsActivityProcessorService } from '@/queue/processors/CheckModeratorsActivityProcessorService.js'; import { StatusError } from '@/misc/status-error.js'; import { IdentifiableError } from '@/misc/identifiable-error.js'; +import { renderInlineError } from '@/misc/render-inline-error.js'; import { UserWebhookDeliverProcessorService } from './processors/UserWebhookDeliverProcessorService.js'; import { SystemWebhookDeliverProcessorService } from './processors/SystemWebhookDeliverProcessorService.js'; import { EndedPollNotificationProcessorService } from './processors/EndedPollNotificationProcessorService.js'; @@ -140,20 +141,8 @@ export class QueueProcessorService implements OnApplicationShutdown { // 何故かeがundefinedで来ることがある if (!e) return '?'; - if (e instanceof Bull.UnrecoverableError || e instanceof AbortError || e.name === 'AbortError') { - return `${e.name}: ${e.message}`; - } - - if (e instanceof StatusError) { - if (e.statusMessage) { - return `${e.name} ${e.statusCode}: ${e.statusMessage}`; - } else { - return `${e.name} ${e.statusCode}`; - } - } - - if (e instanceof IdentifiableError) { - return `${e.name} ${e.id}: ${e.message}`; + if (e instanceof Bull.UnrecoverableError || e instanceof AbortError || e.name === 'AbortError' || e instanceof StatusError || e instanceof IdentifiableError) { + return renderInlineError(e); } return { |