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

SVGO Errors are slient #27

Open
hhsnopek opened this issue Nov 29, 2017 · 1 comment · May be fixed by #28
Open

SVGO Errors are slient #27

hhsnopek opened this issue Nov 29, 2017 · 1 comment · May be fixed by #28

Comments

@hhsnopek
Copy link

Problem

During the investigation of #26, I discovered all the errors from svgo are silent.

Cause

Missing error handler when receiving the svgo results, lib/modules/minifySvg.js#L9

@hhsnopek
Copy link
Author

hhsnopek commented Nov 29, 2017

I can pull request the solution in a short bit, for now I'm dropping the solution here:

svgo.optimize(rendered, ({ error, data }) => {
  if (error) reject(new Error(error))
  resolve(reshapeParser(data, ctx))
})

Backwards compatible node solution:

svgo.optimize(rendered, (res) => {
  if (res.error) reject(new Error(res.error))
  resolve(reshapeParser(res.data, ctx))
})

Edit: added backward compatible solution

@hhsnopek hhsnopek linked a pull request Nov 29, 2017 that will close this issue
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 a pull request may close this issue.

1 participant