Catch timestamp error
This commit is contained in:
parent
6e1c470b69
commit
d8bc02ce46
|
@ -315,9 +315,16 @@ exports.getModule = class MessageListModule extends (
|
|||
let msgNum = 1;
|
||||
self.config.messageList.forEach((listItem, index) => {
|
||||
listItem.msgNum = msgNum++;
|
||||
listItem.ts = moment(listItem.modTimestamp).format(
|
||||
dateTimeFormat
|
||||
);
|
||||
try {
|
||||
listItem.ts = moment(listItem.modTimestamp).format(
|
||||
dateTimeFormat
|
||||
);
|
||||
} catch (e) {
|
||||
self.client.log.warn(
|
||||
`Error parsing "${listItem.modTimestamp}"; expected timestamp: ${e.message}`
|
||||
);
|
||||
listItem.ts = moment().format(dateTimeFormat);
|
||||
}
|
||||
const isNew = _.isBoolean(listItem.isNew)
|
||||
? listItem.isNew
|
||||
: listItem.messageId > self.lastReadId;
|
||||
|
|
Loading…
Reference in New Issue