Fix/error handling in user controller.js#2772
Fix/error handling in user controller.js#2772lindapaiste merged 7 commits intoprocessing:developfrom
Conversation
|
The changes to the function look good. You’ve changed the signature of the function so that it no longer accepts a callback as an argument. So you need to make sure that you have updated all the places where this function is used so that the work with an async/promise call instead of passing a callback. |
|
Please assigned this issue to me @lindapaiste as i have opened the issue and not @Mubashirshariq |
|
@lindapaiste i have deleted the the findUserbyUsername function used directly findbyusername in aws_controller.js and added some neccessary checks |
So what? |
Please check your facts when u say the solution is provided by an 'Indian youtuber' |
|
I don't know why there's drama. It's really not necessary. Open source code is a communal effort where we all build off of each other's code and ideas. It is not a competition. When I looked at this a few days ago there were 3 PRs but none of them solved the issue completely. At that time I went and assigned the issue to @BrawlerXull as they had opened the issue and it was still unresolved. Since then @Mubashirshariq revised their PR and changed their approach. It looks a lot better now, as we are returning proper descriptive API errors when encountering problems. I still need to run the code and make sure it works properly at run-time but the code looks right so I'm considering it "solved". |
lindapaiste
left a comment
There was a problem hiding this comment.
Looks great, I love that you ate using different error codes depending on what the problem is.
Fixes #2762
Changes:
Used promises to handle the asynchronous operation and use async/await for better readability.
Used try-catch blocks to catch any errors that occur during the operation and handle them gracefully.