Better handling of proxy errors / prevent infinite retries when exceptions occur #104
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
An exception that the Proxy might return will not contiain a
message
propertywithin the exception's
InnerMessage
, but the current error reporting logicassumed that there would be a
message
property and then tried to callTrim()
on it. This resulted in a
You cannot call a method on a null-valued expression.
exception.
Because that exception occurred within a try/catch that was within a catch statement,
the outer catch ended up eating the exception, resulting in the retry loop continuing
to try the command, over and over again.
There are two distinct fixes in here as a result:
Only try to call
Trim()
ifInnerMessage.message
exists, otherwise,just report back
InnerMessage
itself.Make sure that the outer catch statement ends with a
throw
to ensurethat any inner exceptions thrown will propagate. As a result, we will
also explicitly
continue
the loop if we are going to perform an auto-retry.