_alnes_
Its an easy question. Ive this try/catch:
TypeScript
try {
const userResponse: Models.User<Models.Preferences> = await users.get(id);
const user = JSON.stringify(userResponse);
return res.send(user);
} catch (err) {
log('Appwrite getUser: Error getting user. id: ' + id);
return res.send(err);
}```
Since there is no res.status, what is the best way to send an error to the client? Just res.send it? This will not trigger the try/catch error handling on the client...
thanks π
TL;DR
To forward an error to the client without res.status in an Express application, developers can set the statusCode manually to a 4xx code. A common approach is to use the res.send method to send the error message to the client but keep in mind that this may not trigger the try/catch error handling on the client side. Joshi
set statusCode to 4xx
Recommended threads
- Need help with createExecution function
Hi, Need some help understanding createExecution. When requesting function execution via createExecution, the function handler arguments are incorrect and rese...
- Realtime with multiple connections
I need the Realtime on multiple Collections for diffrent applicational logic. So my question is: Is there a way to have only 1 Websocket connection or do I need...
- Can't login or deploy functions in Appwr...
Hello, since i updatet to the appwrite cli 6.1.0 i can't login or deploy functions with the cli. When i call the command: "appwrite get account --verbose" i ge...