mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
Handle errors when creating a page save request on savePage
This commit is contained in:
parent
b107a86ba9
commit
3136705a75
1 changed files with 14 additions and 9 deletions
|
|
@ -117,7 +117,6 @@ export const savePage = async (
|
|||
ctx
|
||||
))
|
||||
) {
|
||||
console.log('FAILED TO UPDATE EXISTING PAGE WITH', input)
|
||||
return {
|
||||
errorCodes: [SaveErrorCode.Unknown],
|
||||
message: 'Failed to update existing page',
|
||||
|
|
@ -125,16 +124,22 @@ export const savePage = async (
|
|||
}
|
||||
input.clientRequestId = existingPage.id
|
||||
} else if (shouldParseInBackend(input)) {
|
||||
await createPageSaveRequest(
|
||||
saver.userId,
|
||||
input.url,
|
||||
ctx.models,
|
||||
ctx.pubsub,
|
||||
input.clientRequestId
|
||||
)
|
||||
try {
|
||||
await createPageSaveRequest(
|
||||
saver.userId,
|
||||
input.url,
|
||||
ctx.models,
|
||||
ctx.pubsub,
|
||||
input.clientRequestId
|
||||
)
|
||||
} catch (e) {
|
||||
return {
|
||||
errorCodes: [SaveErrorCode.Unknown],
|
||||
message: 'Failed to create page save request',
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (!(await createPage(articleToSave, ctx))) {
|
||||
console.log('FAILED TO CREATE PAGE WITH INPUT', input)
|
||||
return {
|
||||
errorCodes: [SaveErrorCode.Unknown],
|
||||
message: 'Failed to create new page',
|
||||
|
|
|
|||
Loading…
Reference in a new issue