Skip to content
Merged
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
2 changes: 1 addition & 1 deletion src/Commands/Utilities/REST/ApiRequestHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ public T Get<T>(string url, bool camlCasePolicy = true, bool propertyNameCaseIns
}
catch (Exception e)
{
LogError($"Failed to parse response from server. Error message: '{e.Message}'. Model type to parse it to: '{typeof(T)}'.");
LogError($"Failed to parse response from server. Error message: '{e.Message}'. Received content: '{stringContent.Replace("{", "{{").Replace("}", "}}")}'. Model type to parse it to: '{typeof(T)}'.");
Copy link

Copilot AI May 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Consider extracting the transformation logic for 'stringContent' into a dedicated helper function to improve clarity and maintainability of the logging statement.

Suggested change
LogError($"Failed to parse response from server. Error message: '{e.Message}'. Received content: '{stringContent.Replace("{", "{{").Replace("}", "}}")}'. Model type to parse it to: '{typeof(T)}'.");
LogError($"Failed to parse response from server. Error message: '{e.Message}'. Received content: '{EscapeCurlyBraces(stringContent)}'. Model type to parse it to: '{typeof(T)}'.");

Copilot uses AI. Check for mistakes.
//Cmdlet.LogWarning($"Failed to parse response from server. Error message: '{e.Message}'. Received content: '{stringContent}'. Model type to parse it to: '{typeof(T)}'.");
return default;
}
Expand Down
Loading