From bf0ef17e23454fc18ef759b9bacdb1c00ac1e89c Mon Sep 17 00:00:00 2001 From: syuilo Date: Thu, 11 Oct 2018 02:19:21 +0900 Subject: [PATCH] Improve error logs --- src/models/drive-file.ts | 2 +- src/models/favorite.ts | 2 +- src/models/note.ts | 10 +++++----- src/models/notification.ts | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/models/drive-file.ts b/src/models/drive-file.ts index 0d0886ad0b..ca1a42b053 100644 --- a/src/models/drive-file.ts +++ b/src/models/drive-file.ts @@ -166,7 +166,7 @@ export const pack = ( // (データベースの欠損などで)ファイルがデータベース上に見つからなかったとき if (_file == null) { - console.warn(`in packaging driveFile: driveFile not found on database: ${_file}`); + console.warn(`[DAMAGED DB] (missing) pkg: driveFile :: ${file}`); return resolve(null); } diff --git a/src/models/favorite.ts b/src/models/favorite.ts index 2c10674bcb..4824a6dbaa 100644 --- a/src/models/favorite.ts +++ b/src/models/favorite.ts @@ -79,7 +79,7 @@ export const pack = ( // (データベースの不具合などで)投稿が見つからなかったら if (_favorite.note == null) { - console.warn(`in packaging favorite: note not found on database: ${_favorite.noteId}`); + console.warn(`[DAMAGED DB] (missing) pkg: favorite -> note :: ${_favorite.id} (note ${_favorite.noteId})`); return resolve(null); } diff --git a/src/models/note.ts b/src/models/note.ts index a27c92c572..5687151d80 100644 --- a/src/models/note.ts +++ b/src/models/note.ts @@ -281,9 +281,9 @@ export const pack = async ( _note = deepcopy(note); } - // 投稿がデータベース上に見つからなかったとき + // (データベースの欠損などで)投稿がデータベース上に見つからなかったとき if (_note == null) { - console.warn(`note not found on database: ${note}`); + console.warn(`[DAMAGED DB] (missing) pkg: note :: ${note}`); return null; } @@ -382,17 +382,17 @@ export const pack = async ( //#region (データベースの欠損などで)参照しているデータがデータベース上に見つからなかったとき if (_note.user == null) { - console.warn(`[DAMAGED DB] (missing) in pkg note -> user :: ${_note.id} (user ${_note.userId})`); + console.warn(`[DAMAGED DB] (missing) pkg: note -> user :: ${_note.id} (user ${_note.userId})`); return null; } if (_note.replyId != null && _note.reply == null) { - console.warn(`[DAMAGED DB] (missing) in pkg note -> reply :: ${_note.id} (reply ${_note.replyId})`); + console.warn(`[DAMAGED DB] (missing) pkg: note -> reply :: ${_note.id} (reply ${_note.replyId})`); return null; } if (_note.renoteId != null && _note.renote == null) { - console.warn(`[DAMAGED DB] (missing) in pkg note -> renote :: ${_note.id} (renote ${_note.renoteId})`); + console.warn(`[DAMAGED DB] (missing) pkg: note -> renote :: ${_note.id} (renote ${_note.renoteId})`); return null; } //#endregion diff --git a/src/models/notification.ts b/src/models/notification.ts index 57be4bef10..9e700104ab 100644 --- a/src/models/notification.ts +++ b/src/models/notification.ts @@ -132,7 +132,7 @@ export const pack = (notification: any) => new Promise(async (resolve, reje // (データベースの不具合などで)投稿が見つからなかったら if (_notification.note == null) { - console.warn(`in packaging notification: note not found on database: ${_notification.noteId}`); + console.warn(`[DAMAGED DB] (missing) pkg: notification -> note :: ${_notification.id} (note ${_notification.noteId})`); return resolve(null); } break;