Skip to content

Commit

Permalink
Update error parsing (#54)
Browse files Browse the repository at this point in the history
In some cases the response payload is not as expected. Updating to just trace the error code, and if that is not present, the entire json response.
  • Loading branch information
gboreki authored Jul 16, 2022
1 parent 5f3d42f commit d47663e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions RdlMigration/ConvertRDL.cs
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ private void ConvertAndUploadReport(PowerBIClientWrapper powerBIClient, RdlFileI
{
string jsonString = returnedJsonStr.First();
var returnedJsonDetail = JObject.Parse(jsonString);
errorMessage = returnedJsonDetail["error"]["pbi.error"]["details"][2]["detail"]["value"].Value<string>();
errorMessage = returnedJsonDetail["error"]?["code"]?.Value<string>() ?? jsonString;
Trace($"FAILED TO UPLOAD : {reportName} RequestId:{requestId} {errorMessage}");
}
}
Expand Down Expand Up @@ -697,4 +697,4 @@ private void Trace(string message)
}
}
}
}
}

0 comments on commit d47663e

Please sign in to comment.