Currently, we always read a stream right before an error is thrown (code). However, some teams, such as the storage team, pre-read the errors in their pipelines. This is valid behavior since everyone can have their own response policies. We don't want to raise in this case, since the whole point of this code is just to make sure the error is read before we throw, so we shouldn't error out if the error is read by a previous policy.
To fix, we're going to read the response in a try catch block, and not raise if there's a StreamConsumedError or a StreamClosedError.
cc @vincenttran-msft @jalauzon-msft
Currently, we always read a stream right before an error is thrown (code). However, some teams, such as the storage team, pre-read the errors in their pipelines. This is valid behavior since everyone can have their own response policies. We don't want to raise in this case, since the whole point of this code is just to make sure the error is read before we throw, so we shouldn't error out if the error is read by a previous policy.
To fix, we're going to read the response in a try catch block, and not raise if there's a
StreamConsumedErroror aStreamClosedError.cc @vincenttran-msft @jalauzon-msft