feat(server): introduce user friendly server errors (#7111)

This commit is contained in:
liuyi
2024-06-17 11:30:58 +08:00
committed by GitHub
parent 5307a55f8a
commit 54fc1197ad
65 changed files with 3170 additions and 924 deletions

View File

@@ -1,6 +1,7 @@
import { Inject, Injectable, Optional } from '@nestjs/common';
import { Config } from '../config';
import { MailerServiceIsNotConfigured } from '../error';
import { URLHelper } from '../helpers';
import type { MailerService, Options } from './mailer';
import { MAILER_SERVICE } from './mailer';
@@ -15,7 +16,7 @@ export class MailService {
async sendMail(options: Options) {
if (!this.mailer) {
throw new Error('Mailer service is not configured.');
throw new MailerServiceIsNotConfigured();
}
return this.mailer.sendMail({