NSwag.CodeGeneration.CodeGenerators.TypeScript.SwaggerToTypeScriptClientGenerator.GetExceptionType C# (CSharp) Method

GetExceptionType() private method

private GetExceptionType ( SwaggerOperation operation ) : string
operation SwaggerOperation
return string
        internal override string GetExceptionType(SwaggerOperation operation)
        {
            if (operation.Responses.Count(r => !HttpUtilities.IsSuccessStatusCode(r.Key)) == 0)
                return "string";

            return string.Join(" | ", operation.Responses
                .Where(r => !HttpUtilities.IsSuccessStatusCode(r.Key) && r.Value.Schema != null)
                .Select(r => GetType(r.Value.ActualResponseSchema, r.Value.IsNullable(Settings.CodeGeneratorSettings.NullHandling), "Exception"))
                .Concat(new[] { "string" }));
        }