mirror of
https://github.com/twentyhq/twenty.git
synced 2024-12-26 21:53:48 +03:00
Throw exception when error code is not defined in messaging import
This commit is contained in:
parent
a79b256409
commit
d7ce42cff7
@ -181,11 +181,14 @@ export class MessagingGmailFetchMessagesByBatchesService {
|
|||||||
const historyId = message.historyId;
|
const historyId = message.historyId;
|
||||||
const internalDate = message.internalDate;
|
const internalDate = message.internalDate;
|
||||||
|
|
||||||
assert(id);
|
assert(id, 'ID is missing');
|
||||||
assert(messageId);
|
assert(
|
||||||
assert(threadId);
|
messageId,
|
||||||
assert(historyId);
|
'Message-ID is missing: ' + JSON.stringify(message.payload?.headers),
|
||||||
assert(internalDate);
|
);
|
||||||
|
assert(threadId, 'Thread-ID is missing');
|
||||||
|
assert(historyId, 'History-ID is missing');
|
||||||
|
assert(internalDate, 'Internal date is missing');
|
||||||
|
|
||||||
const bodyData = this.getBodyData(message);
|
const bodyData = this.getBodyData(message);
|
||||||
const text = bodyData ? Buffer.from(bodyData, 'base64').toString() : '';
|
const text = bodyData ? Buffer.from(bodyData, 'base64').toString() : '';
|
||||||
|
Loading…
Reference in New Issue
Block a user