Use node 8 error code (#1557)

This commit is contained in:
Gus Caplan
2017-06-01 14:14:42 -05:00
committed by Crawl
parent 37d6624ef1
commit a2520efa1a

View File

@@ -9,7 +9,7 @@ function fetch(Encoder, engineOptions) {
try {
return new Encoder(engineOptions);
} catch (err) {
if (err.message.includes('Cannot find module')) return null;
if (err.code === 'MODULE_NOT_FOUND') return null;
// The Opus engine exists, but another error occurred.
throw err;