Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[csharp][generichost] Fix local var #19642

Merged
merged 3 commits into from
Sep 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
if (!suppressDefaultLog)
Logger.LogError(exception, "An error occurred while sending the request to the server.");
if (!suppressDefaultLogLocalVar)
Logger.LogError(exceptionLocalVar, "An error occurred while sending the request to the server.");
Original file line number Diff line number Diff line change
Expand Up @@ -303,30 +303,30 @@ namespace {{packageName}}.{{apiPackage}}
/// <summary>
/// Logs exceptions that occur while retrieving the server response
/// </summary>
/// <param name="exception"></param>
/// <param name="pathFormat"></param>
/// <param name="path"></param>
/// <param name="exceptionLocalVar"></param>
/// <param name="pathFormatLocalVar"></param>
/// <param name="pathLocalVar"></param>
{{#allParams}}
/// <param name="{{paramName}}"></param>
{{/allParams}}
private void OnError{{operationId}}DefaultImplementation({{#lambda.joinWithComma}}Exception exception string pathFormat string path {{#allParams}}{{^required}}Option<{{/required}}{{{dataType}}}{{>NullConditionalParameter}}{{^required}}>{{/required}} {{paramName}} {{/allParams}}{{/lambda.joinWithComma}})
private void OnError{{operationId}}DefaultImplementation({{#lambda.joinWithComma}}Exception exceptionLocalVar string pathFormatLocalVar string pathLocalVar {{#allParams}}{{^required}}Option<{{/required}}{{{dataType}}}{{>NullConditionalParameter}}{{^required}}>{{/required}} {{paramName}} {{/allParams}}{{/lambda.joinWithComma}})
{
bool suppressDefaultLog = false;
OnError{{operationId}}({{#lambda.joinWithComma}}ref suppressDefaultLog exception pathFormat path {{#allParams}}{{paramName}} {{/allParams}}{{/lambda.joinWithComma}});
bool suppressDefaultLogLocalVar = false;
OnError{{operationId}}({{#lambda.joinWithComma}}ref suppressDefaultLogLocalVar exceptionLocalVar pathFormatLocalVar pathLocalVar {{#allParams}}{{paramName}} {{/allParams}}{{/lambda.joinWithComma}});
{{>OnErrorDefaultImplementation}}
}

/// <summary>
/// A partial method that gives developers a way to provide customized exception handling
/// </summary>
/// <param name="suppressDefaultLog"></param>
/// <param name="exception"></param>
/// <param name="pathFormat"></param>
/// <param name="path"></param>
/// <param name="suppressDefaultLogLocalVar"></param>
/// <param name="exceptionLocalVar"></param>
/// <param name="pathFormatLocalVar"></param>
/// <param name="pathLocalVar"></param>
{{#allParams}}
/// <param name="{{paramName}}"></param>
{{/allParams}}
partial void OnError{{operationId}}({{#lambda.joinWithComma}}ref bool suppressDefaultLog Exception exception string pathFormat string path {{#allParams}}{{^required}}Option<{{/required}}{{{dataType}}}{{>NullConditionalParameter}}{{^required}}>{{/required}} {{paramName}} {{/allParams}}{{/lambda.joinWithComma}});
partial void OnError{{operationId}}({{#lambda.joinWithComma}}ref bool suppressDefaultLogLocalVar Exception exceptionLocalVar string pathFormatLocalVar string pathLocalVar {{#allParams}}{{^required}}Option<{{/required}}{{{dataType}}}{{>NullConditionalParameter}}{{^required}}>{{/required}} {{paramName}} {{/allParams}}{{/lambda.joinWithComma}});

/// <summary>
/// {{summary}} {{notes}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,27 +172,27 @@ private void AfterListDefaultImplementation(IListApiResponse apiResponseLocalVar
/// <summary>
/// Logs exceptions that occur while retrieving the server response
/// </summary>
/// <param name="exception"></param>
/// <param name="pathFormat"></param>
/// <param name="path"></param>
/// <param name="exceptionLocalVar"></param>
/// <param name="pathFormatLocalVar"></param>
/// <param name="pathLocalVar"></param>
/// <param name="personId"></param>
private void OnErrorListDefaultImplementation(Exception exception, string pathFormat, string path, string personId)
private void OnErrorListDefaultImplementation(Exception exceptionLocalVar, string pathFormatLocalVar, string pathLocalVar, string personId)
{
bool suppressDefaultLog = false;
OnErrorList(ref suppressDefaultLog, exception, pathFormat, path, personId);
if (!suppressDefaultLog)
Logger.LogError(exception, "An error occurred while sending the request to the server.");
bool suppressDefaultLogLocalVar = false;
OnErrorList(ref suppressDefaultLogLocalVar, exceptionLocalVar, pathFormatLocalVar, pathLocalVar, personId);
if (!suppressDefaultLogLocalVar)
Logger.LogError(exceptionLocalVar, "An error occurred while sending the request to the server.");
}

/// <summary>
/// A partial method that gives developers a way to provide customized exception handling
/// </summary>
/// <param name="suppressDefaultLog"></param>
/// <param name="exception"></param>
/// <param name="pathFormat"></param>
/// <param name="path"></param>
/// <param name="suppressDefaultLogLocalVar"></param>
/// <param name="exceptionLocalVar"></param>
/// <param name="pathFormatLocalVar"></param>
/// <param name="pathLocalVar"></param>
/// <param name="personId"></param>
partial void OnErrorList(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, string personId);
partial void OnErrorList(ref bool suppressDefaultLogLocalVar, Exception exceptionLocalVar, string pathFormatLocalVar, string pathLocalVar, string personId);

/// <summary>
///
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,25 +155,25 @@ private void AfterRootGetDefaultImplementation(IRootGetApiResponse apiResponseLo
/// <summary>
/// Logs exceptions that occur while retrieving the server response
/// </summary>
/// <param name="exception"></param>
/// <param name="pathFormat"></param>
/// <param name="path"></param>
private void OnErrorRootGetDefaultImplementation(Exception exception, string pathFormat, string path)
/// <param name="exceptionLocalVar"></param>
/// <param name="pathFormatLocalVar"></param>
/// <param name="pathLocalVar"></param>
private void OnErrorRootGetDefaultImplementation(Exception exceptionLocalVar, string pathFormatLocalVar, string pathLocalVar)
{
bool suppressDefaultLog = false;
OnErrorRootGet(ref suppressDefaultLog, exception, pathFormat, path);
if (!suppressDefaultLog)
Logger.LogError(exception, "An error occurred while sending the request to the server.");
bool suppressDefaultLogLocalVar = false;
OnErrorRootGet(ref suppressDefaultLogLocalVar, exceptionLocalVar, pathFormatLocalVar, pathLocalVar);
if (!suppressDefaultLogLocalVar)
Logger.LogError(exceptionLocalVar, "An error occurred while sending the request to the server.");
}

/// <summary>
/// A partial method that gives developers a way to provide customized exception handling
/// </summary>
/// <param name="suppressDefaultLog"></param>
/// <param name="exception"></param>
/// <param name="pathFormat"></param>
/// <param name="path"></param>
partial void OnErrorRootGet(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path);
/// <param name="suppressDefaultLogLocalVar"></param>
/// <param name="exceptionLocalVar"></param>
/// <param name="pathFormatLocalVar"></param>
/// <param name="pathLocalVar"></param>
partial void OnErrorRootGet(ref bool suppressDefaultLogLocalVar, Exception exceptionLocalVar, string pathFormatLocalVar, string pathLocalVar);

/// <summary>
///
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,25 +155,25 @@ private void AfterRootGetDefaultImplementation(IRootGetApiResponse apiResponseLo
/// <summary>
/// Logs exceptions that occur while retrieving the server response
/// </summary>
/// <param name="exception"></param>
/// <param name="pathFormat"></param>
/// <param name="path"></param>
private void OnErrorRootGetDefaultImplementation(Exception exception, string pathFormat, string path)
/// <param name="exceptionLocalVar"></param>
/// <param name="pathFormatLocalVar"></param>
/// <param name="pathLocalVar"></param>
private void OnErrorRootGetDefaultImplementation(Exception exceptionLocalVar, string pathFormatLocalVar, string pathLocalVar)
{
bool suppressDefaultLog = false;
OnErrorRootGet(ref suppressDefaultLog, exception, pathFormat, path);
if (!suppressDefaultLog)
Logger.LogError(exception, "An error occurred while sending the request to the server.");
bool suppressDefaultLogLocalVar = false;
OnErrorRootGet(ref suppressDefaultLogLocalVar, exceptionLocalVar, pathFormatLocalVar, pathLocalVar);
if (!suppressDefaultLogLocalVar)
Logger.LogError(exceptionLocalVar, "An error occurred while sending the request to the server.");
}

/// <summary>
/// A partial method that gives developers a way to provide customized exception handling
/// </summary>
/// <param name="suppressDefaultLog"></param>
/// <param name="exception"></param>
/// <param name="pathFormat"></param>
/// <param name="path"></param>
partial void OnErrorRootGet(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path);
/// <param name="suppressDefaultLogLocalVar"></param>
/// <param name="exceptionLocalVar"></param>
/// <param name="pathFormatLocalVar"></param>
/// <param name="pathLocalVar"></param>
partial void OnErrorRootGet(ref bool suppressDefaultLogLocalVar, Exception exceptionLocalVar, string pathFormatLocalVar, string pathLocalVar);

/// <summary>
///
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -207,27 +207,27 @@ private void AfterCall123TestSpecialTagsDefaultImplementation(ICall123TestSpecia
/// <summary>
/// Logs exceptions that occur while retrieving the server response
/// </summary>
/// <param name="exception"></param>
/// <param name="pathFormat"></param>
/// <param name="path"></param>
/// <param name="exceptionLocalVar"></param>
/// <param name="pathFormatLocalVar"></param>
/// <param name="pathLocalVar"></param>
/// <param name="modelClient"></param>
private void OnErrorCall123TestSpecialTagsDefaultImplementation(Exception exception, string pathFormat, string path, ModelClient modelClient)
private void OnErrorCall123TestSpecialTagsDefaultImplementation(Exception exceptionLocalVar, string pathFormatLocalVar, string pathLocalVar, ModelClient modelClient)
{
bool suppressDefaultLog = false;
OnErrorCall123TestSpecialTags(ref suppressDefaultLog, exception, pathFormat, path, modelClient);
if (!suppressDefaultLog)
Logger.LogError(exception, "An error occurred while sending the request to the server.");
bool suppressDefaultLogLocalVar = false;
OnErrorCall123TestSpecialTags(ref suppressDefaultLogLocalVar, exceptionLocalVar, pathFormatLocalVar, pathLocalVar, modelClient);
if (!suppressDefaultLogLocalVar)
Logger.LogError(exceptionLocalVar, "An error occurred while sending the request to the server.");
}

/// <summary>
/// A partial method that gives developers a way to provide customized exception handling
/// </summary>
/// <param name="suppressDefaultLog"></param>
/// <param name="exception"></param>
/// <param name="pathFormat"></param>
/// <param name="path"></param>
/// <param name="suppressDefaultLogLocalVar"></param>
/// <param name="exceptionLocalVar"></param>
/// <param name="pathFormatLocalVar"></param>
/// <param name="pathLocalVar"></param>
/// <param name="modelClient"></param>
partial void OnErrorCall123TestSpecialTags(ref bool suppressDefaultLog, Exception exception, string pathFormat, string path, ModelClient modelClient);
partial void OnErrorCall123TestSpecialTags(ref bool suppressDefaultLogLocalVar, Exception exceptionLocalVar, string pathFormatLocalVar, string pathLocalVar, ModelClient modelClient);

/// <summary>
/// To test special tags To test special tags and operation ID starting with number
Expand Down
Loading
Loading