Skip to content
Snippets Groups Projects
Commit cc149e2f authored by syuilo's avatar syuilo
Browse files

fix(server): エラーのスタックトレースは返さないように

Fix #10064
parent cedfb85b
No related branches found
No related tags found
No related merge requests found
......@@ -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)
......
......@@ -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,
},
});
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment