Skip to content

Commit 5e975cb

Browse files
committed
Fix to log instead of throwing error on parse note id
Signed-off-by: Max Wu <jackymaxj@gmail.com>
1 parent c7657ae commit 5e975cb

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

lib/models/note.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,8 @@ module.exports = function (sequelize, DataTypes) {
216216
var id = LZString.decompressFromBase64(noteId)
217217
if (id && Note.checkNoteIdValid(id)) { return callback(null, id) } else { return _callback(null, null) }
218218
} catch (err) {
219-
return _callback(err, null)
219+
logger.error(err)
220+
return _callback(null, null)
220221
}
221222
},
222223
parseNoteIdByBase64Url: function (_callback) {
@@ -225,7 +226,8 @@ module.exports = function (sequelize, DataTypes) {
225226
var id = Note.decodeNoteId(noteId)
226227
if (id && Note.checkNoteIdValid(id)) { return callback(null, id) } else { return _callback(null, null) }
227228
} catch (err) {
228-
return _callback(err, null)
229+
logger.error(err)
230+
return _callback(null, null)
229231
}
230232
},
231233
parseNoteIdByShortId: function (_callback) {

0 commit comments

Comments
 (0)