Make sure all errors use the serializer set for the logger

This commit is contained in:
Daniel García Aubert
2020-06-03 17:32:16 +02:00
parent 1dda183a31
commit 210f5b01ec
10 changed files with 19 additions and 10 deletions
+4 -2
View File
@@ -342,7 +342,8 @@ function incrementMapViews ({ metadataBackend }) {
mapConfigProvider.getMapConfig((err, mapConfig) => {
if (err) {
logger.warn(err, `ERROR: failed to increment mapview count for user '${user}'`);
err.message = `Failed to increment mapview count for user '${user}'. ${err.message}`;
logger.warn({ error: err });
return next();
}
@@ -354,7 +355,8 @@ function incrementMapViews ({ metadataBackend }) {
metadataBackend.incMapviewCount(user, statTag, (err) => {
if (err) {
logger.warn(err, `ERROR: failed to increment mapview count for user '${user}'`);
err.message = `Failed to increment mapview count for user '${user}'. ${err.message}`;
logger.warn({ error: err });
}
next();