Fix to log instead of throwing error on parse note id

Signed-off-by: Max Wu <jackymaxj@gmail.com>
This commit is contained in:
Max Wu 2018-03-11 02:52:24 +08:00
parent c7657ae81e
commit 5e975cbe69

View file

@ -216,7 +216,8 @@ module.exports = function (sequelize, DataTypes) {
var id = LZString.decompressFromBase64(noteId)
if (id && Note.checkNoteIdValid(id)) { return callback(null, id) } else { return _callback(null, null) }
} catch (err) {
return _callback(err, null)
logger.error(err)
return _callback(null, null)
}
},
parseNoteIdByBase64Url: function (_callback) {
@ -225,7 +226,8 @@ module.exports = function (sequelize, DataTypes) {
var id = Note.decodeNoteId(noteId)
if (id && Note.checkNoteIdValid(id)) { return callback(null, id) } else { return _callback(null, null) }
} catch (err) {
return _callback(err, null)
logger.error(err)
return _callback(null, null)
}
},
parseNoteIdByShortId: function (_callback) {