Added logging system

This commit is contained in:
RemixDev
2022-02-28 14:58:25 +01:00
parent e1f7451e51
commit 1e14eb5b6b
16 changed files with 258 additions and 63 deletions

View File

@@ -5,7 +5,8 @@ import { ApiHandler } from '../../../types'
import { sessionDZ } from '../../../app'
import { isObjectEmpy } from '../../../helpers/primitive-checks'
import { BadRequestError, isBadRequestError, consoleError } from '../../../helpers/errors'
import { BadRequestError, isBadRequestError } from '../../../helpers/errors'
import { logger } from '../../../helpers/logger'
export interface RawChartTracksQuery {
id: string
@@ -32,7 +33,7 @@ const handler: RequestHandler<{}, {}, {}, RawChartTracksQuery> = async (req, res
return res.status(200).send(response)
} catch (error) {
if (isBadRequestError(error)) {
consoleError(error.message)
logger.error(error.message)
res.status(400).send()
return next()
}