Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
baywet authored Oct 3, 2023
1 parent bd2e5e2 commit 5c9fb9f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- The default status code response is now used as 4XX and 5XX when those class responses are not provided in the description. [#3245](https://github.com/microsoft/kiota/issues/3245)
- Adds codes files in typescript to reduce number of generated files. [#2116](https://github.com/microsoft/kiota/issues/2116)
- Fix null reference exception when a parameter is defined without a schema. (CLI).
- Log a message to stderr if a request is skipped due to missing data. (CLI) [2210](https://github.com/microsoft/kiota/issues/2210)
- Log a message to stderr if a request is skipped due to missing data. (CLI) [#2210](https://github.com/microsoft/kiota/issues/2210)

## [1.6.1] - 2023-09-11

Expand Down
6 changes: 2 additions & 4 deletions src/Kiota.Builder/Writers/CLI/CliCodeMethodWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -664,8 +664,7 @@ protected virtual void WriteCommandHandlerBody(CodeMethod codeElement, CodeClass

// Check for null model
// Add logging with reason for skipped execution here
writer.WriteLine("if (model is null)");
writer.StartBlock();
writer.StartBlock("if (model is null)");
writer.WriteLine("Console.Error.WriteLine(\"No model data to send.\");");
writer.WriteLine("return;");
writer.CloseBlock();
Expand All @@ -679,8 +678,7 @@ protected virtual void WriteCommandHandlerBody(CodeMethod codeElement, CodeClass
requestBodyParam.Name = "stream";
// Check for file existence
// Add logging with reason for skipped execution here
writer.WriteLine($"if ({pName} is null || !{pName}.Exists)");
writer.StartBlock();
writer.StartBlock($"if ({pName} is null || !{pName}.Exists)");
writer.WriteLine("Console.Error.WriteLine(\"No available file to send.\");");
writer.WriteLine("return;");
writer.CloseBlock();
Expand Down

0 comments on commit 5c9fb9f

Please sign in to comment.