Skip to content
Permalink
Browse files

Use string.Empty rather than null as the default response text when t…

…hrowing exceptions (#2505)
  • Loading branch information...
Numpsy authored and RicoSuter committed Nov 4, 2019
1 parent 49c5fc5 commit a0a2c214a92b6d3fa5c596fff56af72468812145
@@ -49,6 +49,6 @@ return;
{% endif -%}
{% endif -%}
{% else -%}{% comment %} implied: `if !response.HasType` so just read it as text {% endcomment %}
string responseText_ = ( response_.Content == null ) ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
throw new {{ ExceptionClass }}("{{ response.ExceptionDescription }}", (int)response_.StatusCode, responseText_, headers_, null);
{% endif -%}

0 comments on commit a0a2c21

Please sign in to comment.
You can’t perform that action at this time.