nimbella / nimbella-deployer

The Nimbella platform deployer library
Apache License 2.0
2 stars 4 forks source link

Don't fail mysteriously when package.json corrupt #85

Closed joshuaauerbachwatson closed 2 years ago

joshuaauerbachwatson commented 2 years ago

When there was a syntax error in package.json, the failure could be cryptic because there was no context suggesting that npm or yarn had been invoked. That happened because the deployer attempted to parse package.json itself to determine whether there is a build script in it and that parse attempt was not guarded by try/catch. This change simply adds the guard to prevent the parse exception from propagating. There is no special handling for the failure (other than ignoring it) because the next step will be to invoke npm or yarn, which will fail much more informatively.