Open3
JS Promise
const promiseFunc = () =>
new Promise((resolve, reject) => {
throw new Error("error");
});
const promiseFunc = () =>
new Promise((resolve, reject) => {
reject("error");
});
両方とも try-catch すると catch に入る
const main = async () => {
console.time("func");
try {
promiseFunc();
} catch (err) {
console.log(err);
}
console.timeEnd("func");
};
await
しないとcatch
できない