Closed granthusbands closed 5 months ago
The library deliberately doesn't throw any exceptions.
Instead all API calls resolve in a promise that returns a result object that the user (you) can check for errors. See the migration document.
The error messages are as descriptive as possible or they are passed on directly from the cloud storage service. The result objects are documented per API call in the readme.
Exceptions are to be implemented in user code (your code) so you can decide yourself whether or not the exception is blocking.
The lack of exceptions has been very surprising. Exceptions are easy to work with in modern JS (especially with async/await), and being able to create broken Storage instances that quietly fail on every operation has just cost me quite a lot of debugging time. Similarly, missing a bucketName for a writeFile on a local storage adapter, even though such a thing is meaningless, has also been painful.
Is there any way to enable exceptions?