Handling Errors with try-catch-finally
What modern error handling feature is demonstrated?
async function example() {
try {
await riskyOperation();
} catch (error) {
throw new CustomError('Operation failed', { cause: error });
}
}
async function example() {
try {
await riskyOperation();
} catch (error) {
throw new CustomError('Operation failed', { cause: error });
}
}