Merge pull request #1704 from omnivore-app/fix/importer-logging
Improve logging on errors in the importer tool
This commit is contained in:
@ -166,7 +166,6 @@ const sendSavePageMutation = async (userId: string, input: unknown) => {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
})
|
||||
console.log('save page response: ', response)
|
||||
|
||||
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
|
||||
return !!response.data.data.savePage
|
||||
@ -256,7 +255,12 @@ export const importHandler = Sentry.GCPFunction.wrapHttpFunction(
|
||||
const pubSubMessage = req.body.message.data as string
|
||||
const obj = getStorageEvent(pubSubMessage)
|
||||
if (obj) {
|
||||
await handleEvent(obj)
|
||||
try {
|
||||
await handleEvent(obj)
|
||||
} catch (err) {
|
||||
console.log('error handling event', { err, obj })
|
||||
throw err
|
||||
}
|
||||
}
|
||||
} else {
|
||||
console.log('no pubsub message')
|
||||
|
||||
@ -29,15 +29,6 @@ export const createCloudTask = async (
|
||||
const serviceAccountEmail = `${project}@appspot.gserviceaccount.com`
|
||||
|
||||
const parent = cloudTask.queuePath(project, location, queue)
|
||||
console.log(`Task creation options: `, {
|
||||
project,
|
||||
location,
|
||||
queue,
|
||||
taskHandlerUrl,
|
||||
serviceAccountEmail,
|
||||
payload,
|
||||
})
|
||||
|
||||
const convertedPayload = JSON.stringify(payload)
|
||||
const body = Buffer.from(convertedPayload).toString('base64')
|
||||
const task: protos.google.cloud.tasks.v2.ITask = {
|
||||
|
||||
Reference in New Issue
Block a user