Power-Fx icon indicating copy to clipboard operation
Power-Fx copied to clipboard

System.NotImplementedException because of missing Check for JSON in HttpFunctionInvoker.cs:DecodeResponseAsync

Open ckkashyap opened this issue 1 year ago • 2 comments

We ran into the following exception while calling a connector. It would be better if Pfx throws a PowerFxConnectorException here.

System.NotImplementedException: Expecting a StringType but got Record at Microsoft.PowerFx.Types.FormulaValueJSON.FromJson(JsonElement element, FormulaType formulaType, Boolean numberIsFloat) at Microsoft.PowerFx.Types.FormulaValueJSON.RecordFromJsonObject(JsonElement element, RecordType recordType, Boolean numberIsFloat) at Microsoft.PowerFx.Types.FormulaValueJSON.FromJson(JsonElement element, FormulaType formulaType, Boolean numberIsFloat) at Microsoft.PowerFx.Types.FormulaValueJSON.TableFromJsonArray(JsonElement array, TableType tableType, Boolean numberIsFloat) at Microsoft.PowerFx.Types.FormulaValueJSON.FromJson(JsonElement element, FormulaType formulaType, Boolean numberIsFloat) at Microsoft.PowerFx.Types.FormulaValueJSON.FromJson(String jsonString, FormulaType formulaType, Boolean numberIsFloat) at Microsoft.PowerFx.Connectors.HttpFunctionInvoker.DecodeResponseAsync(HttpResponseMessage response, Boolean throwOnError)

ckkashyap avatar Dec 14 '23 22:12 ckkashyap

Beyond providing a better exception/error, I'd like to understand better what leads to this issue. Can you provide more information on how to reproduce this issue?

LucGenetier avatar Dec 18 '23 08:12 LucGenetier

See https://msazure.visualstudio.com/CCI/_workitems/edit/26055433

LucGenetier avatar Jan 10 '24 16:01 LucGenetier