Print better error messages if project.json fails to parse
This commit is contained in:
parent
0e4d154134
commit
6e8a5ad1e9
|
|
@ -855,7 +855,16 @@ functions
|
||||||
|
|
||||||
static void GetDependencies(string projectJsonPath, HashSet<string> dependencies)
|
static void GetDependencies(string projectJsonPath, HashSet<string> dependencies)
|
||||||
{
|
{
|
||||||
var project = (JsonObject)Json.Deserialize(File.ReadAllText(projectJsonPath));
|
JsonObject project;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
project = (JsonObject)Json.Deserialize(File.ReadAllText(projectJsonPath));
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Console.Error.WriteLine("Failed to parse project at path " + projectJsonPath + Environment.NewLine + ex.Message);
|
||||||
|
throw;
|
||||||
|
}
|
||||||
var dependenciesNode = project.ValueAsJsonObject("dependencies");
|
var dependenciesNode = project.ValueAsJsonObject("dependencies");
|
||||||
AddKeys(dependencies, dependenciesNode);
|
AddKeys(dependencies, dependenciesNode);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue