When writing/using an API, which is preferable? *...
# codingconventions
t
When writing/using an API, which is preferable? Option 1: Limit the number of exceptions thrown in the core implementation by returning a
Result
object, then add extension functions to throw additional exceptions if responses aren't considered successful. Option 2: Simplify return of functions in the base implementation by returning value of successful call and throwing exceptions when responses aren't considered successful, then add extension functions to capture the possible exceptions/error cases in a
Result
object.