let promise = new Promise((resolve,reject)=>{
try {
resolve("some data");
} catch (error) {
reject(error);
}
})
promise.then(function (data) {
console.log(data);
},function (error) {
console.error(error);
})