Handle errors in Amazon API
This commit is contained in:
parent
b0fcf55071
commit
3428986268
3 changed files with 70 additions and 58 deletions
|
@ -2,6 +2,7 @@ import co from 'co';
|
|||
import kue from 'kue';
|
||||
import raven from 'raven';
|
||||
import debuglog from 'debug';
|
||||
import { inspect } from 'util';
|
||||
|
||||
import models from './models';
|
||||
import services from './lib/services';
|
||||
|
@ -51,16 +52,16 @@ function search(data, done) {
|
|||
} catch (err) {
|
||||
debug(`Error searching on: ${service.id}`);
|
||||
debug(share);
|
||||
debug(err);
|
||||
debug(inspect(err, { depth: 5 }));
|
||||
raven.captureException(err);
|
||||
return done(err);
|
||||
}
|
||||
}).catch((err) => {
|
||||
debug(`Error searching on: ${service.id}`);
|
||||
debug(share);
|
||||
debug(err);
|
||||
debug(inspect(err, { depth: 5 }));
|
||||
raven.captureException(err);
|
||||
return done();
|
||||
return done(err);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue