The question is simple, but I haven't found the answer anywhere.
When should i use try catch? in the code below I use try catch to handle the return of a request:
async findUsers() {
this.loading = true;
try {
const [users, count] = await this.api.get('/users/list');
this.users = users;
this.totalPages = Math.ceil(parseInt(count) / 10);
}
catch (error) {
this.Messages.requestFailed(error);
}
finally {
this.loading = false;
}
}
Would it be a good practice to use then(...).catch(...)?