I have a toast manager try catch block and it works as I expect it
showToast(status: string, message: string) {
try {
if (status === 'success') {
this.toastr.showSuccessToast(message)
}
else if (status === 'warning'){
this.toastr.showWarningToast(message)
}
else {
this.toastr.showErrorToast(message)
}
} catch {
console.log('Toast failed');
}
It seems to me this maybe inefficent but i don't know if I should remove the try catch or the if condition