In all SDKs for node and web implement industry best practice error reporting and error codes
I have been working on multiple projects that use Firebase, I use the Firebase JS SDK and the Firebase Admin SDK. And I am always pulling my hair out with the error reporting and the ability to handle in the SDKs returned errors. This is especially annoying when using TypeScript.
There is also no master list of all error codes that an SDK can produce. That means I can get random error that I have to back trace to then add handling for it. Also I have to infer types all the time instead of using instanceof
to check if it is an SDK error and get TS support.
Please document all the error codes that each SDK could produce.
Add a page to the documentation site about Error handling in the SDK (helps to explain how it works in this SDK if not very obvious)
Please add a proper typescript Error object to the SDK. This would be a class that extends Error object and for the code property has all the possible codes it can produce. By doing this, the developers will be required to add to the list of error codes that the SDK has on the error if they add a new code when then trigger the error handling code. This means that users as they upgrade get more options in the SDK that they can use to see the new error types that have occurred.
Contribution policy on the GitHub library that describes the error handling approach that has been placed and the expectations that are required for future code inclusion. This stops this from going backwards.
99/100 I want the error code only and adding either or both would save 100s of hours of hair pulling (I don't want to look like Frank van Puffelen to soon).
I acknowledge that this has been partially done, but an overhaul that finishes it would be much appreciated.