diff --git a/CHANGELOG.md b/CHANGELOG.md index ebc776243..a6a90b39f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,6 +27,7 @@ You should also include the user name that made the change. - fix(client): Android ChromeでPWAとしてインストールできない問題を修正 - 未知のユーザーが deleteActor されたら処理をスキップする - fix(server): notes/createで、fileIdsと見つかったファイルの数が異なる場合はエラーにする +- fix(server): エラーのスタックトレースは返さないように ## 13.7.5 (2023/02/24) diff --git a/packages/backend/src/server/api/ApiCallService.ts b/packages/backend/src/server/api/ApiCallService.ts index 347fa59d3..6d8540dd4 100644 --- a/packages/backend/src/server/api/ApiCallService.ts +++ b/packages/backend/src/server/api/ApiCallService.ts @@ -2,6 +2,7 @@ import { pipeline } from 'node:stream'; import * as fs from 'node:fs'; import { promisify } from 'node:util'; import { Inject, Injectable } from '@nestjs/common'; +import { v4 as uuid } from 'uuid'; import { DI } from '@/di-symbols.js'; import { getIpHash } from '@/misc/get-ip-hash.js'; import type { LocalUser, User } from '@/models/entities/User.js'; @@ -320,6 +321,7 @@ export class ApiCallService implements OnApplicationShutdown { if (err instanceof ApiError) { throw err; } else { + const errId = uuid(); this.logger.error(`Internal error occurred in ${ep.name}: ${err.message}`, { ep: ep.name, ps: data, @@ -327,14 +329,15 @@ export class ApiCallService implements OnApplicationShutdown { message: err.message, code: err.name, stack: err.stack, + id: errId, }, }); - console.error(err); + console.error(err, errId); throw new ApiError(null, { e: { message: err.message, code: err.name, - stack: err.stack, + id: errId, }, }); }