mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-24 18:02:47 +08:00
feat(server): introduce user friendly server errors (#7111)
This commit is contained in:
@@ -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({
|
||||
|
||||
Reference in New Issue
Block a user