Skip to content

Commit

Permalink
fix: error handling in processSyncXLogCommand
Browse files Browse the repository at this point in the history
  • Loading branch information
niracler committed Jan 18, 2024
1 parent 2ab0a50 commit 5174655
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/xlog/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ export async function processSyncXLogCommand(update: TelegramUpdate, env: Env):

const response = await createShort(title, content, attachmentUrlList, env)

if (response.ok === false || !response.error) {
return `Failed to post to XLog: ${response}`
if (!response.data ) {
return `Failed to post to XLog: ${JSON.stringify(response)}`
} else {
// TODO: debug mode
return `Your message has been posted to XLog. data: ${JSON.stringify(response.data)}` //, metadata: ${JSON.stringify(attachmentUrlList)}, response: ${JSON.stringify(photoUrlList)}`
Expand Down

0 comments on commit 5174655

Please sign in to comment.