Open3

JS Promise

katayama8000katayama8000
const promiseFunc = () =>
  new Promise((resolve, reject) => {
    throw new Error("error");
  });
const promiseFunc = () =>
  new Promise((resolve, reject) => {
    reject("error");
  });
katayama8000katayama8000
const main = async () => {
  console.time("func");
  try {
    promiseFunc();
  } catch (err) {
    console.log(err);
  }
  console.timeEnd("func");
};

awaitしないとcatchできない