diff options
author | Chocobozzz <me@florianbigard.com> | 2018-08-31 11:43:46 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-08-31 11:43:46 +0200 |
commit | 328e607d32d7f1e960f8966a70097b030e386ab4 (patch) | |
tree | 348297cadda55d616ece20a39ff1a827ece0c7d8 /server.ts | |
parent | d6ca951b3cc7cb19ad9f52249444fc68c5d81d50 (diff) | |
download | PeerTube-328e607d32d7f1e960f8966a70097b030e386ab4.tar.gz PeerTube-328e607d32d7f1e960f8966a70097b030e386ab4.tar.zst PeerTube-328e607d32d7f1e960f8966a70097b030e386ab4.zip |
Add sql trace in error log on sequelize error
Diffstat (limited to 'server.ts')
-rw-r--r-- | server.ts | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -166,7 +166,10 @@ app.use(function (err, req, res, next) { | |||
166 | error = err.stack || err.message || err | 166 | error = err.stack || err.message || err |
167 | } | 167 | } |
168 | 168 | ||
169 | logger.error('Error in controller.', { err: error }) | 169 | // Sequelize error |
170 | const sql = err.parent ? err.parent.sql : undefined | ||
171 | |||
172 | logger.error('Error in controller.', { err: error, sql }) | ||
170 | return res.status(err.status || 500).end() | 173 | return res.status(err.status || 500).end() |
171 | }) | 174 | }) |
172 | 175 | ||