Api Response Handler
On top of the
handle method for the sake of brevity the following methods have been added:
handleSuccess method attempts to parse the
ApiResponse and returns its value.
handleError is an async method that throws the captured error from handleSuccess.
handleFinally method is an empty function for the sake of type suggestion when customising with any logic after the requests. This runs regardless of whether an error was throw or not in the previous handleError method.