Skip to content
This repository was archived by the owner on Dec 18, 2017. It is now read-only.
This repository was archived by the owner on Dec 18, 2017. It is now read-only.

Need better error when project.json is malformed #735

@yishaigalatzer

Description

@yishaigalatzer

Repro steps

Create a folder
create a project.json file that doesn't match the json spec (say just put hello world)
kpm build

Result - Error (expected) see below, but no physical path to where it happens, so when kpm build runs inside a script you don't get enough input to where things happened.

Would like to get the full physical path to the project.json file (if available)

Error example

Newtonsoft.Json.JsonReaderException: Unexpected character encountered while pars
ing value: E. Path '', line 0, position 0.
   at Newtonsoft.Json.JsonTextReader.ParseValue()
   at Newtonsoft.Json.JsonTextReader.ReadInternal()
   at Newtonsoft.Json.JsonTextReader.Read()
   at Newtonsoft.Json.Linq.JObject.Load(JsonReader reader)
   at Newtonsoft.Json.Linq.JObject.Parse(String json)
   at Microsoft.Framework.Runtime.Project.GetProject(String json, String project
Name, String projectPath)
   at Microsoft.Framework.Runtime.Project.TryGetProject(String path, Project& pr
oject)
   at Microsoft.Framework.PackageManager.BuildManager.Build()
   at Microsoft.Framework.PackageManager.Program.<>c__DisplayClass3.<Main>b__12(
)
   at Microsoft.Framework.Runtime.Common.CommandLine.CommandLineApplication.Exec
ute(String[] args)
   at Microsoft.Framework.PackageManager.Program.Main(String[] args)

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions