reduce, clarify, and normalize more error messages

This commit is contained in:
Hazelnoot 2025-03-16 12:37:46 -04:00
parent b2c5029c3e
commit ce08bd1b42
34 changed files with 114 additions and 97 deletions

View file

@ -12,6 +12,7 @@ import { DI } from '@/di-symbols.js';
import { NotificationService } from '@/core/NotificationService.js';
import { IdentifiableError } from '@/misc/identifiable-error.js';
import type { MiScheduleNoteType } from '@/models/NoteSchedule.js';
import { renderInlineError } from '@/misc/render-inline-error.js';
import { QueueLoggerService } from '../QueueLoggerService.js';
import type * as Bull from 'bullmq';
import type { ScheduleNotePostJobData } from '../types.js';
@ -129,10 +130,11 @@ export class ScheduleNotePostProcessorService {
channel,
}).catch(async (err: IdentifiableError) => {
this.notificationService.createNotification(me.id, 'scheduledNoteFailed', {
reason: err.message,
reason: renderInlineError(err),
});
await this.noteScheduleRepository.remove(data);
throw this.logger.error(`Schedule Note Failed Reason: ${err.message}`);
this.logger.error(`Scheduled note failed:`, err);
throw err;
});
await this.noteScheduleRepository.remove(data);
this.notificationService.createNotification(me.id, 'scheduledNotePosted', {