Danger: Overloaded Constructors Ahead

#102 · ✸ 12 · 💬 14 · one month ago · calebwrites.substack.com · karagenit
During my time there, I quickly learned how seriously they take customer trust at SFDC. As a software engineer, a big part of this is writing quality code that's bug-free. It would merely return a generic error for the NPE instead of the proper error message & code. So let's dive in, and hopefully learn a little about the dangers of manually refactoring code, especially when overloaded constructors are involved! Public ErrorResponse(int successCount, int errorCount, String errorMsg);. Public ErrorResponse(int successCount, int errorCount, String successMsg, String errorMsg);. Public ErrorResponse(int successCount, int errorCount, String warningMsg, String errorMsg); public ErrorResponse(int successCount, int errorCount, String successMsg, String warningMsg, String errorMsg);. The response handler code was fragile and inherently susceptible to this sort of problem - if it hadn't happened here, it probably would've happened somewhere else.
Danger: Overloaded Constructors Ahead



Archive | Send Feedback | WebAssembly Version (beta)