error system change
This commit is contained in:
@@ -1,13 +1,17 @@
|
|||||||
const GetFlix = require('../index');
|
const GetFlix = require('../index');
|
||||||
|
|
||||||
const getflix = new GetFlix({ tmdbApiKey: 'f29e56ff85f361ff01b5c5403a343021' });
|
const getflix = new GetFlix({ tmdbApiKey: 'f29e56ff85f361ff01b5c5403a343021' });
|
||||||
|
|
||||||
getflix.getInfo('70143836', (err, res)=>{
|
try {
|
||||||
if(err){
|
getflix.getInfo('70143836', (res) => {
|
||||||
|
if (res.error) {
|
||||||
console.log(err);
|
console.log(err);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
console.log(res);
|
console.log(res);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
}
|
||||||
|
catch (error) {
|
||||||
|
console.log(error.message)
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user