Back

Crashing Function does go happy path in Promise

  • 0
  • Web
tbsvttr
8 Aug, 2023, 18:04

Crashing function gives back status failed and status code 500, but the promise does go in onfulfilled, not in onrejected. This makes error handling hard.

TL;DR
The crashing function appears to be returning a status of 'failed' and a status code of 500. However, the promise does not go into the onrejected state as expected, making error handling difficult. One suggested solution is to check the result and throw an exception in the client to handle the error appropriately.
tbsvttr
8 Aug, 2023, 18:06
tbsvttr
8 Aug, 2023, 18:06

First screenshot is code, second one result on browser console.

tbsvttr
8 Aug, 2023, 18:09

Causes code like this. 😦

Drake
9 Aug, 2023, 00:57

This is expected because the function execution was created successfully. you can check the result and throw an exception in your client if you'd like

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more