appwrite / sdk-for-node

[READ-ONLY] Official Appwrite Node.js SDK 🟒

Home Page:https://appwrite.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

πŸ› Bug Report: Node App terminates if appwrite server is offline

Capsicum42 opened this issue Β· comments

commented

πŸ‘Ÿ Reproduction steps

I tried the following in my node app

 try {
    const _response = databases.createDocument(
      process.env.APPWRITE_DATABASE_ID,
      process.env.APPWRITE_COLLECTION_ID,
      uuidv4(),
      {
        query: query as string,
        userId: auth0UserId as string,
      },
    )
  } catch (e) {
    console.log(e)
  }

It works as expected.

πŸ‘ Expected behavior

When the appwrite server is not available I expect, that my node server continue running and displays the error in the console.

πŸ‘Ž Actual Behavior

My node server stops working with:

[2023-05-11T12:44:36.447Z] Error: 
    at Client.call (/Users/holger/Documents/GitHub/pzh-server/node_modules/node-appwrite/lib/client.js:170:31)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at Databases.createDocument (/Users/holger/Documents/GitHub/pzh-server/node_modules/node-appwrite/lib/services/databases.js:1666:16)
[ERROR] 14:44:36 Error

"node-appwrite": "^9.0.0",

🎲 Appwrite version

Version 0.10.x

πŸ’» Operating system

Linux

🧱 Your Environment

No response

πŸ‘€ Have you spent some time to check if this issue has been raised before?

  • I checked and didn't find similar issue

🏒 Have you read the Code of Conduct?

commented

My fault. I forgot the await.