error system change

This commit is contained in:
Wise Colt
2019-01-01 01:22:48 +03:00
parent 19be7e4c50
commit 604a237d08

View File

@@ -1,13 +1,17 @@
const GetFlix = require('../index'); const GetFlix = require('../index');
const getflix = new GetFlix({ tmdbApiKey: 'f29e56ff85f361ff01b5c5403a343021' });
const getflix = new GetFlix({tmdbApiKey : 'f29e56ff85f361ff01b5c5403a343021'}); try {
getflix.getInfo('70143836', (res) => {
getflix.getInfo('70143836', (err, res)=>{ if (res.error) {
if(err){ console.log(err);
console.log(err); }
} else {
else{ console.log(res);
console.log(res); }
} })
}) }
catch (error) {
console.log(error.message)
}