quaertym / ember-cli-dependency-checker

Ember CLI addon for checking missing node and bower dependencies before running ember commands
MIT License
40 stars 38 forks source link

Better error message possible #48

Open offirgolan opened 9 years ago

offirgolan commented 9 years ago

A try catch here would allow us to include which package failed.

The existing error message is as follows:

Invalid Version: *
TypeError: Invalid Version: *
    at new SemVer (/Users/offirgolan/Documents/Projects/Ember-Components/ember-cp-validations/node_modules/ember-cli-dependency-checker/node_modules/semver/semver.js:295:11)
    at Range.test (/Users/offirgolan/Documents/Projects/Ember-Components/ember-cp-validations/node_modules/ember-cli-dependency-checker/node_modules/semver/semver.js:1049:15)
    at Function.satisfies (/Users/offirgolan/Documents/Projects/Ember-Components/ember-cp-validations/node_modules/ember-cli-dependency-checker/node_modules/semver/semver.js:1098:16)
    at Function.VersionChecker.satisfies (/Users/offirgolan/Documents/Projects/Ember-Components/ember-cp-validations/node_modules/ember-cli-dependency-checker/lib/version-checker.js:31:17)
    at Package.updateRequired (/Users/offirgolan/Documents/Projects/Ember-Components/ember-cp-validations/node_modules/ember-cli-dependency-checker/lib/package.js:21:26)
    at Package.init (/Users/offirgolan/Documents/Projects/Ember-Components/ember-cp-validations/node_modules/ember-cli-dependency-checker/lib/package.js:15:27)
    at new Package (/Users/offirgolan/Documents/Projects/Ember-Components/ember-cp-validations/node_modules/ember-cli-dependency-checker/lib/package.js:4:13)
    at EmberCLIDependencyChecker.<anonymous> (/Users/offirgolan/Documents/Projects/Ember-Components/ember-cp-validations/node_modules/ember-cli-dependency-checker/lib/dependency-checker.js:122:12)
    at Array.map (native)
    at EmberCLIDependencyChecker.readDependencies (/Users/offirgolan/Documents/Projects/Ember-Components/ember-cp-validations/node_modules/ember-cli-dependency-checker/lib/dependency-checker.js:118:36)

Proposed error message:

Package: <Package Name> - <Reason>
Path: <Path>
# ... rest of stack trace
konradjurk commented 8 years ago

+1

Folaht commented 8 years ago

+1

quaertym commented 8 years ago

@offirgolan Interested in submitting a PR?