finalize error handling (and related test) when receiving an invalid response from the analysis service