diff options
author | Max Wu | 2018-03-11 02:52:24 +0800 |
---|---|---|
committer | Max Wu | 2018-03-11 02:52:24 +0800 |
commit | 5e975cbe690048e144fb6bd99c5b239a3e764445 (patch) | |
tree | 4019bbd4c9f9a4085f8468c0d3f834e95e7a1ed9 /lib | |
parent | c7657ae81e23102cedd31543ee111d2736dc3b22 (diff) |
Fix to log instead of throwing error on parse note id
Signed-off-by: Max Wu <jackymaxj@gmail.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/models/note.js | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/models/note.js b/lib/models/note.js index dc4d187b..d615bcf7 100644 --- a/lib/models/note.js +++ b/lib/models/note.js @@ -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) { |