We're updating the issue view to help you get more done. 

deploy.js should error if deploy.json contains invalid JSON

Description

From: http://forums.enyojs.com/discussion/2066/why-are-errors-parsing-finding-deploy-json-silenced?

Today I tried to run the deploy script for one of our apps, and I failed to get things working even though the deploy script didn't throw any errors.

Turns out I had a syntax error in my deploy.json file, but enyo's deploy.js file specifically catches the error and silently puts a default manifest in place instead.

I would think it'd be better for any deployment script is to fail early rather than to fail silently. Is there a particular/good reason to fail silently?

Response:

Hey Ruben – looks like poor error handling to me. I'm guessing the code in the catch (that creates the default manifest) was intended for the case where a library didn't specify a deploy.json, which we do not intend to be compulsory (the readFileSync would throw an error on non-existent file), in which case we use the default. However, in the case a deploy.json DOES exist and the JSON doesn't parse correctly, I agree we should definitely error out with a message so the user knows their JSON is bad. Should be a simple fix.

Environment

All

Status

Assignee

Kevin Schaaf (Enyo Team)

Reporter

Kevin Schaaf (Enyo Team)

Labels

External issue ID

None

Tango Test Run Elements

None

Old Issue Key

None

Components

Affects versions

2.4.0

Priority

None