mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-06-04 22:59:01 +02:00
fix unit tests
GitOrigin-RevId: 34b2aad1b2f4a59909265b60e415d31fd178e9ee
This commit is contained in:
@@ -4,16 +4,24 @@ const logger = require('logger-sharelatex')
|
||||
function log(providerId, sessionId, data) {
|
||||
try {
|
||||
const samlLog = new SamlLog()
|
||||
samlLog.providerId = (providerId || '').toString()
|
||||
samlLog.sessionId = (sessionId || '').toString().substr(0, 8)
|
||||
samlLog.jsonData = JSON.stringify(data)
|
||||
samlLog.providerId = providerId = (providerId || '').toString()
|
||||
samlLog.sessionId = sessionId = (sessionId || '').toString().substr(0, 8)
|
||||
try {
|
||||
samlLog.jsonData = JSON.stringify(data)
|
||||
} catch (err) {
|
||||
// log but continue on data errors
|
||||
logger.error(
|
||||
{ err, sessionId, providerId },
|
||||
'SamlLog JSON.stringify Error'
|
||||
)
|
||||
}
|
||||
samlLog.save(err => {
|
||||
if (err) {
|
||||
logger.error({ err, sessionId, providerId }, 'SamlLog Error')
|
||||
}
|
||||
})
|
||||
} catch (err) {
|
||||
logger.error({ err, sessionId, providerId }, 'SamlLog JSON.stringify Error')
|
||||
logger.error({ err, sessionId, providerId }, 'SamlLog Error')
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user