I've inherited a codebase which is full of functions like this:
const someFunc = async (): Promise<string> => {
return new Promise(async (resolve, reject) => {
try {
const result = await doSomething();
resolve(result);
} catch (error) {
reject(error);
}
});
};
It is my understanding that since the error is not handled in the catch
this is essentially the same as doing this:
const someFunc = (): Promise<string> => {
return doSomething();
};
Did I miss something?