Error
?const parent = () => {
// ...
try {
fs.readFile(fileName, (err, content) => {
if (err) {
throw new Error();
}
})
} catch (e) {
return;
}
// ...
}
const parent = () => {
// ...
let success = true;
fs.readFile(fileName, (err, content) => {
if (err) {
success = false;
return;
}
})
if (!success) return;
// ...
}