enhance(logging): ログの情報を増やす (MisskeyIO#351)

This commit is contained in:
まっちゃとーにゅ 2024-01-11 11:41:20 +09:00 committed by GitHub
parent 38469c2b87
commit 91e4522a96
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
21 changed files with 100 additions and 57 deletions

View file

@ -148,7 +148,7 @@ export class EmailService {
this.logger.info(`Message sent: ${info.messageId}`);
} catch (err) {
this.logger.error(err as Error);
this.logger.error('Failed to send email', { error: err });
throw err;
}
}
@ -286,18 +286,18 @@ export class EmailService {
Authorization: truemailAuthKey
},
});
const json = (await res.json()) as {
email: string;
success: boolean;
errors?: {
errors?: {
list_match?: string;
regex?: string;
mx?: string;
smtp?: string;
} | null;
};
if (json.email === undefined || (json.email !== undefined && json.errors?.regex)) {
return {
valid: false,
@ -322,7 +322,7 @@ export class EmailService {
reason: json.errors?.list_match as T || 'blacklist',
};
}
return {
valid: true,
reason: null,