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?
In
util.getFileReplacement
where the file is local, the callback cannot be reached if the file can't be found: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 useencodeSync
and that throws. So this would have to be surrounded with atry...catch
?Let me know if I'm missing a trick here.