DEV Community

loading...

Discussion on: Modern JavaScript, 10 things you should be using, starting today

Collapse
ankurloriya profile image
Ankur Loriya

Use try catch

try {
     await UserService.create(name, email);
} catch(error) {
    // Handle error
}