We have (4.5.0.0) Version of Microsoft.PowerBI.API installed ,there is no change in Import Model in latest 4.20.0.0 also. Problem is in Import Model class there is no property exposed which provides me Error Info about Import . It has a property of ImportState which return status as succedded ,Publishing and Failed but I need to Know the Cause of the ImportState Failed Error.
Adding try catch is not helpful as it does not throw exception when Import is Failed ,it Just returns ImportState as Failed .I refered the GitHub Project also regarding this Microsoft API Model .There is no exposed property which provides us ImportError (PowerBI-CSharp/sdk/PowerBI.Api/Source/Models/Import.cs at master · microsoft/PowerBI-CSharp · GitHub)
Import import = await io.PostImportWithFileAsyncInGroup(WorkspaceID, file, "FILENAME" ImportConflictHandlerMode.CreateOrOverwrite, cancellationToken: token);
import.ImportState --> failed no exception , (no exposed property to understand importerror)