handle logs that cannot be stringified/parsed

This commit is contained in:
Anton Georgiev 2018-12-05 21:38:19 +00:00
parent a236fd071b
commit dbb2a63d56

View File

@ -101,7 +101,14 @@ class JoinHandler extends Component {
.then((resp) => {
setLogoutURL(resp.logoutURL);
if (resp.returncode !== 'FAILED') {
logger.info(`User successfully went through main.joinRouteHandler with [${JSON.stringify(resp)}].`);
let logString;
try {
logString = JSON.stringify(resp);
} catch (e) {
logger.error(`Could not stringify object ${resp}`)
logString = resp;
}
logger.info(`User successfully went through main.joinRouteHandler with [${logString}].`);
return resolve(resp);
}
const e = new Error('Session not found');