err handling

This commit is contained in:
pringgosutono
2026-05-05 11:56:05 +07:00
parent a0dd34e1d7
commit 1f331869ca

View File

@ -156,6 +156,8 @@ class GpsTracksModels {
const mm = moment.unix(date).format("MM")
const yy = moment.unix(date).format("YY")
logs.id = resLogs.insertId
try {
await MysqlHelpers.queryTrx(
conn,
`
@ -164,6 +166,13 @@ class GpsTracksModels {
`,
[logs],
)
} catch (error) {
console.log(error)
fs.appendFileSync(
path.join(__dirname, `error_data_log.txt`),
JSON.stringify(logs) + `\n`,
)
}
// console.log("insert tracks_${yy}${mm} : " + rltm.device_id)
}
}