mirror of
https://github.com/azures04/crafatar.git
synced 2026-05-06 19:10:38 +02:00
throw more errirs
This commit is contained in:
3
skins.js
3
skins.js
@@ -12,9 +12,11 @@ var lwip = require('lwip');
|
|||||||
function extract_face(inname, outname, callback) {
|
function extract_face(inname, outname, callback) {
|
||||||
var outfile = fs.createWriteStream(outname);
|
var outfile = fs.createWriteStream(outname);
|
||||||
lwip.open(inname, function(err, image) {
|
lwip.open(inname, function(err, image) {
|
||||||
|
if (err) throw err;
|
||||||
image.batch()
|
image.batch()
|
||||||
.crop(8, 8, 15, 15)
|
.crop(8, 8, 15, 15)
|
||||||
.writeFile(outname, function(err) {
|
.writeFile(outname, function(err) {
|
||||||
|
if (err) throw err;
|
||||||
callback();
|
callback();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -30,6 +32,7 @@ module.exports = {
|
|||||||
res.on('data', function(d) {
|
res.on('data', function(d) {
|
||||||
var profile = JSON.parse(d);
|
var profile = JSON.parse(d);
|
||||||
if (profile.error) {
|
if (profile.error) {
|
||||||
|
// usually this is something like TooManyRequestsException
|
||||||
console.error(profile.error);
|
console.error(profile.error);
|
||||||
callback(null);
|
callback(null);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user