summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/history.js6
-rw-r--r--lib/models/note.js6
2 files changed, 10 insertions, 2 deletions
diff --git a/lib/history.js b/lib/history.js
index 63be4521..9c389bfa 100644
--- a/lib/history.js
+++ b/lib/history.js
@@ -47,7 +47,11 @@ function getHistory (userid, callback) {
}
} catch (err) {
// most error here comes from LZString, ignore
- logger.error(err)
+ if (err.message === 'Cannot read property \'charAt\' of undefined') {
+ logger.warning('Looks like we can not decode "' + history[i].id + '" with LZString. Can be ignored.')
+ } else {
+ logger.error(err)
+ }
}
}
history = parseHistoryToObject(history)
diff --git a/lib/models/note.js b/lib/models/note.js
index ec7e2b13..0e8dd4dd 100644
--- a/lib/models/note.js
+++ b/lib/models/note.js
@@ -227,7 +227,11 @@ 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) {
- logger.error(err)
+ if (err.message === 'Cannot read property \'charAt\' of undefined') {
+ logger.warning('Looks like we can not decode "' + noteId + '" with LZString. Can be ignored.')
+ } else {
+ logger.error(err)
+ }
return _callback(null, null)
}
},