Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 512537

Summary: Tern should forward any starting errors
Product: [ECD] Orion Reporter: Michael Rennie <Michael_Rennie>
Component: JS ToolsAssignee: Michael Rennie <Michael_Rennie>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P2    
Version: 13.0   
Target Milestone: 14.0   
Hardware: PC   
OS: Mac OS X   
Whiteboard:

Description Michael Rennie CLA 2017-02-21 18:36:18 EST
Currently, if we ship off the JSON to start the Tern server and there is something wrong with it, or with a custom definition / plugin, Tern silently fails and we are in a busted state.

We should add error handling to Tern and make sure problems are forwarded back to the tern worker (to make sure we gracefully fall back to the default state) and then forwarded on to the JS plugin and logged.

Steps:

1. create new project
2. create .definitions folder in it
3. add the following def (named foo.json):

{
  "!define": {
    "busted": {
      "!type": bool
    }
  }
}
4. create a .tern-project file with the following:
{
  "plugins": {"node":{}},
  "libs": [".definitions/foo.json"]
}
5. create a js file so Tern will try to start

Tern will fail to start and the tooling will not work. The reason is the bad definition file (its missing a "!name" entry).