diff --git a/src/services/npdl.ts b/src/services/npdl.ts index 22906dc..a5b5b8e 100644 --- a/src/services/npdl.ts +++ b/src/services/npdl.ts @@ -3,6 +3,7 @@ import subdomain from 'express-subdomain'; import { getTaskFile } from '@/database'; import { getCDNFileStream } from '@/util'; import { Stream } from 'node:stream'; +import { LOG_ERROR } from '@/logger'; const npdl = express.Router(); @@ -41,7 +42,7 @@ npdl.get([ Stream.pipeline(readStream, response, (err) => { if (err) { - console.error('Error with response stream: ', err.message); + LOG_ERROR('Error with response stream: ' + err.message); response.end(); } }); diff --git a/src/util.ts b/src/util.ts index b8fbbd5..d258518 100644 --- a/src/util.ts +++ b/src/util.ts @@ -12,6 +12,7 @@ import { GetUserFriendPIDsResponse } from '@pretendonetwork/grpc/friends/get_use import { config, disabledFeatures } from '@/config-manager'; import { NodeJsClient } from '@smithy/types'; import { Response } from 'express'; +import { LOG_ERROR } from '@/logger'; let s3: NodeJsClient; @@ -68,7 +69,7 @@ export function fileErrCallback(response: Response) { if (!response.headersSent) { response.status(500).send('Server Error'); } - console.error('Error in sending file: ', err); + LOG_ERROR('Error in sending file: ' + err.message); } } };