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

Error cannot trigger when local file is not found #43

Open
scandox opened this issue Sep 17, 2018 · 0 comments
Open

Error cannot trigger when local file is not found #43

scandox opened this issue Sep 17, 2018 · 0 comments

Comments

@scandox
Copy link

scandox commented Sep 17, 2018

In util.getFileReplacement where the file is local, the callback cannot be reached if the file can't be found:

var result = ( new datauri( util.getInlineFilePath( src, settings.relativeTo ) ) ).content;
callback( result === undefined ? new Error( "Local file not found" ) : null, result );

The second line won't be reached if datauri throws an error. As I understand it calling datauri constructor with just a file path means it will use encodeSync and that throws. So this would have to be surrounded with a try...catch?

Let me know if I'm missing a trick here.

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

1 participant