Add success check to QPlanRequestExecutor
What file or files will be changed by the refactor
QPlanRequestExecutor
and any clients that use it to make requests.
Describe what changes will be made by the refactor
Throw a custom type error if the response.isSuccess
field is not true, with information on why it failed.
Describe the benefits of the refactor
This will simplify client code as there are many places that compute if (response.isSuccess){...}
. It also helps enable more dynamic error handling where the custom type could be checked for in a catch block and a different error message made if the thrown error was not due to the back end responding with known errors (e.g. an auth error rather than a bad request).