Back

[SOLVED] Cannot return status code from function

  • 0
  • Flutter
  • Functions
Ipsoka
28 Mar, 2023, 18:51

Heey, i dont seem to be able to return status codes from my dart functions, am I missing something?

return res.json( {"message": "E-Mail is missing."}, 400, );

TL;DR
The user was having an issue with returning status codes from a function in Dart. Another user suggested that they might need to remove the 'return' keyword before 'res.json'. This turned out to be the solution.
safwan
28 Mar, 2023, 18:53

I haven't used dart for server-side code, but are you sure you need to return res.json, and not just res.json?

Ipsoka
28 Mar, 2023, 18:55

Shouldnt make a difference in dart world

rafagazani
28 Mar, 2023, 19:46

return res.json( {"message": "E-Mail is missing."}, status: 400, )

rafagazani
28 Mar, 2023, 22:48

@Ipsoka managed to solve?

Ipsoka
29 Mar, 2023, 17:19

YES! It worked

Ipsoka
29 Mar, 2023, 17:20

[SOLVED] Cannot return status code from function

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