From 87643df023f08a87afabb489e308f05230556337 Mon Sep 17 00:00:00 2001 From: Hector Leon Zarco Garcia Date: Thu, 13 Oct 2016 13:54:29 +0200 Subject: [PATCH] Throw error if readFile fails --- src/node/index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/node/index.js b/src/node/index.js index a5e2603..0f6eed1 100644 --- a/src/node/index.js +++ b/src/node/index.js @@ -32,6 +32,7 @@ function loadImage(image, cb){ // TODO: support URLs if(typeof image === 'string'){ fs.readFile(image, function(err, buffer){ + if (err) throw err; loadImage(buffer, cb) }) return