Add debug logs

This commit is contained in:
Hongbo Wu
2023-04-22 12:29:46 +08:00
parent 2760ce60f0
commit 187ad654e7
2 changed files with 8 additions and 2 deletions

View File

@ -173,7 +173,7 @@ export abstract class ContentHandler {
(await this.parseNewsletterUrl(headers, html)) || generateUniqueUrl()
const author = this.parseAuthor(from)
const unsubscribe = headers['list-unsubscribe']
? this.parseUnsubscribe(headers['list-unsubscribe']?.toString())
? this.parseUnsubscribe(headers['list-unsubscribe'].toString())
: undefined
return {

View File

@ -189,7 +189,13 @@ export const inboundEmailHandler = Sentry.GCPFunction.wrapHttpFunction(
})
res.send('newsletter received')
} catch (error) {
console.log('error handling emails, will forward.', from, to, subject)
console.log(
'error handling emails, will forward.',
from,
to,
subject,
error
)
// queue error emails
await pubsub.topic(NON_NEWSLETTER_EMAIL_TOPIC).publishMessage({
json: {