diff --git a/custom_templates/Configuration.mustache b/custom_templates/Configuration.mustache index c6e4b432..b7a4df25 100644 --- a/custom_templates/Configuration.mustache +++ b/custom_templates/Configuration.mustache @@ -56,13 +56,11 @@ namespace {{packageName}}.Client string.Format("Error calling {0}: {1}", methodName, response.RawContent), response.RawContent, response.Headers); } - {{^netStandard}} - if (status == 0) + if (status == 0 || !string.IsNullOrEmpty(response.ErrorText)) { return new ApiException(status, string.Format("Error calling {0}: {1}", methodName, response.ErrorText), response.ErrorText); } - {{/netStandard}} return null; }; diff --git a/openapi-config.yml b/openapi-config.yml index 819e9a45..90fa25f7 100644 --- a/openapi-config.yml +++ b/openapi-config.yml @@ -3,3 +3,4 @@ packageName: Bandwidth.Standard packageTags: Bandwidth targetFramework: netstandard2.0 templateDir: custom_templates +packageGuid: "{0B827FE6-C4E9-4144-A195-8A00B3C063F4}" diff --git a/src/Bandwidth.Standard/Client/Configuration.cs b/src/Bandwidth.Standard/Client/Configuration.cs index 603438e5..7d645de5 100644 --- a/src/Bandwidth.Standard/Client/Configuration.cs +++ b/src/Bandwidth.Standard/Client/Configuration.cs @@ -60,6 +60,11 @@ public class Configuration : IReadableConfiguration string.Format("Error calling {0}: {1}", methodName, response.RawContent), response.RawContent, response.Headers); } + if (status == 0 || !string.IsNullOrEmpty(response.ErrorText)) + { + return new ApiException(status, + string.Format("Error calling {0}: {1}", methodName, response.ErrorText), response.ErrorText); + } return null; };