summaryrefslogtreecommitdiff
path: root/lib/history.js
diff options
context:
space:
mode:
authorSheogorath2018-07-27 13:56:07 +0200
committerSheogorath2018-07-27 15:42:58 +0200
commitdb5b86df4c735a4ed80e1ae683dc58e15f819e0b (patch)
treebae511f4370cc0e170cdce8953761a6a437e3d9b /lib/history.js
parent1f85017625bfd414f3b1a0d94ecbc37dc70d712a (diff)
Further improvement of error handling for LZString
This does some more in depth check on the error message and minimizes the log noise that is caused by LZString. Signed-off-by: Sheogorath <sheogorath@shivering-isles.com>
Diffstat (limited to 'lib/history.js')
-rw-r--r--lib/history.js6
1 files changed, 5 insertions, 1 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)