mirror of
https://github.com/azures04/crafatar.git
synced 2026-03-22 07:51:17 +01:00
throw more errirs
This commit is contained in:
parent
d4954c062f
commit
aa521eb64d
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 {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user