The Problem
When uploading an entity using DataService.PostAsync(), it appears that the intent is for any errors (e.g. validation exceptions) to be put in the resulting IntuitResponse's Fault field. However, the SDK instead throws a QuickBooksSharp.QuickBooksException.
Solution
I suggest either:
- Removing the
Fault field altogether in favor of exceptions.
- Sending exceptions to the
Fault field and sealing access to the Response field behind a getter function that throws the error if present (a la Rust's Result<T, E>.unwrap()), accompanied by an IsError field/property.
I am personally in favor of the latter solution, as it would encourage users to explicitly handle errors.
The Problem
When uploading an entity using
DataService.PostAsync(), it appears that the intent is for any errors (e.g. validation exceptions) to be put in the resultingIntuitResponse'sFaultfield. However, the SDK instead throws aQuickBooksSharp.QuickBooksException.Solution
I suggest either:
Faultfield altogether in favor of exceptions.Faultfield and sealing access to theResponsefield behind a getter function that throws the error if present (a la Rust'sResult<T, E>.unwrap()), accompanied by anIsErrorfield/property.I am personally in favor of the latter solution, as it would encourage users to explicitly handle errors.