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

Output errors? #15

Closed
RobLoach opened this issue Dec 10, 2014 · 8 comments
Closed

Output errors? #15

RobLoach opened this issue Dec 10, 2014 · 8 comments

Comments

@RobLoach
Copy link
Contributor

When SASS building fails, it just outputs:

> metalsmith
  Metalsmith · undefined

We do return the error, should Metalsmith do a better job of error reporting?

@stevenschobert
Copy link
Owner

Hey @RobLoach. Yeah, it definitely should be printing our something more useful than that. Can you provide some more details about what you're seeing?

I had thought @ubenzer had fixed that in #12, but maybe something changed since then.

If so, we can add a test case for it for future reference.

@stevenschobert
Copy link
Owner

@RobLoach Were you still having issues with this?

@RobLoach
Copy link
Contributor Author

@stevenschobert I believe I fixed the error with that pull request branch. Will do more testing and report back.

@RobLoach
Copy link
Contributor Author

Syntax errors still report undefined from Metalsmith.

@stevenschobert
Copy link
Owner

@RobLoach How are you handling errors in your project? Any compilation errors should be available through Metalsmith's build callback (this was handled in #12).

metalsmith(__dirname)
  .use(sass())
  .build(function done(err) {
    // err should contain errors
  });

@thiagodemellobueno
Copy link

@stevenschobert we're using metalsmith.json, is there a catch (or a plugin) that can gracefully handle errors in a similar manner?

@stevenschobert
Copy link
Owner

Corrected in v0.6.1! Sorry about that folks, looks like when it was implemented in #12, errors were being passed up the chain as a simple string.

Metalsmith's CLI expects the error to be an actual Error object. I've updated the tests and patched it in 9a15861.

Let me know if that works for you!

@RobLoach
Copy link
Contributor Author

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

No branches or pull requests

3 participants