Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide useful error message when styles/app.[ext] is not found #1866

Closed
wants to merge 1 commit into from

Conversation

jmonster
Copy link

@jmonster jmonster commented Sep 4, 2014

To avoid future developer confusion as witnessed on issue #1641. This PR provides improved error messaging to assist developers in debugging their applications; it does not fix any actual bugs [since the problem is not really a bug].

@jmonster jmonster changed the title Provide useful error message when styles/app.ext is not found Provide useful error message when styles/app.[ext] is not found Sep 4, 2014
To avoid future developer confusion as witnessed on issue ember-cli#1641

if (!ext) {
var attemptedExtensions = Array.isArray(this.ext) ? this.ext : [this.ext];
throw new Error('app/styles/app.[' + attemptedExtensions.join('/') + '] does not exist');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you throw a SilentError instead?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jmonster - Ping?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i got this one.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

running tests locally now

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Absolutely just time constraints, I'll try to get to it this evening. On Fri, Sep 5, 2014 at 1:20 PM, stefanpenner/ember-cli [email protected] wrote: In lib/preprocessors/style-plugin.js:

@@ -15,7 +15,14 @@ StylePlugin.prototype.constructor = StylePlugin;
StylePlugin.prototype._superConstructor = Plugin;

StylePlugin.prototype.toTree = function(tree, inputPath, outputPath, options) {

  • var input = path.join(inputPath, 'app.' + this.getExt(inputPath, 'app'));
  • var ext = this.getExt(inputPath, 'app');
  • if (!ext) {
  • var attemptedExtensions = Array.isArray(this.ext) ? this.ext : [this.ext];
  • throw new Error('app/styles/app.[' + attemptedExtensions.join('/') + '] does not exist');

@jmonster - Ping?

—Reply to this email directly or view it on GitHub.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No worries, we updated in another commit/pr and merged. Thank you!!

@stefanpenner
Copy link
Contributor

superseded by: #1894

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants