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

better error message in ReadOnlySymbolTable.ValidateAccepts

Open MikeStall opened this issue 2 years ago • 0 comments

In SymbolValue.Set(slot, value) , we will call ReadOnlySymbolTable.ValidateAccepts to verify a type match.

This gives cryptic errors like: System.InvalidOperationException: 'Can't change ''Products:NLPayload_37368736'' from Microsoft.PowerFx.Types.TableType to *[ID:w, Name:s, Price:w].'

Make this message easier to debug. At least include both the name and destination types (or ideally the recent field comparison checks to tell us which fields don't match)

MikeStall avatar Nov 19 '23 19:11 MikeStall