Well, congrats you got rid of try/catch but you got another issue which is you can't change either the error code or the error message. Basically, when you design a software to fullfil business needs, you need to be flexible, you should care about returning the right message and code more than using try/catch.
Thank you, someone already commented about this but as i said it's out of the article scope, so i will either edit the article or write another one for this particular issue.
If you need a solution you can checkout my node-ts kit you'll fine out what you seek.
Here it is: github.com/osclancer/node-ts
Thanks again ♥️
hey bro, i am starting a node express project using your formula.
please give me your feedback for this pattern where i use another wrapper that call service (between route and controller i use service for my db connections)
i eageryl waiting for your feedback about this pattern, :)
Salah Assi
Software Engineer
Well, congrats you got rid of try/catch but you got another issue which is you can't change either the error code or the error message. Basically, when you design a software to fullfil business needs, you need to be flexible, you should care about returning the right message and code more than using try/catch.
Thanks anyway 😅