Catch timestamp error
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user