You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
there is no .catch(), but this is alright(it will still throw a 500 error as expected) since .query will return a rejected promise with the value of err anyway.
since you are throwing this error when calling postData, the 500 handler will take care of this.
but in case you dont want to pass the entire error around(maybe just err.message for example), or if you want to console.log the error at the query stage instead of in your controller, adding a .then() for the response, and a .catch() for the error would help.
The text was updated successfully, but these errors were encountered:
week8-jach/src/model/queries/postData.js
Lines 3 to 6 in 84ec974
there is no .catch(), but this is alright(it will still throw a 500 error as expected) since .query will return a rejected promise with the value of err anyway.
week8-jach/src/controllers/index.js
Lines 38 to 48 in 84ec974
since you are throwing this error when calling postData, the 500 handler will take care of this.
but in case you dont want to pass the entire error around(maybe just err.message for example), or if you want to console.log the error at the query stage instead of in your controller, adding a .then() for the response, and a .catch() for the error would help.
The text was updated successfully, but these errors were encountered: