Explorar o código

throw more errirs

jomo %!s(int64=10) %!d(string=hai) anos
pai
achega
aa521eb64d
Modificáronse 1 ficheiros con 3 adicións e 0 borrados
  1. 3 0
      skins.js

+ 3 - 0
skins.js

@@ -12,9 +12,11 @@ var lwip = require('lwip');
 function extract_face(inname, outname, callback) {
   var outfile = fs.createWriteStream(outname);
   lwip.open(inname, function(err, image) {
+    if (err) throw err;
     image.batch()
     .crop(8, 8, 15, 15)
     .writeFile(outname, function(err) {
+      if (err) throw err;
       callback();
     });
   });
@@ -30,6 +32,7 @@ module.exports = {
       res.on('data', function(d) {
         var profile = JSON.parse(d);
         if (profile.error) {
+          // usually this is something like TooManyRequestsException
           console.error(profile.error);
           callback(null);
         } else {