#25 - Dart Create Custom Exception Class | How to Handle Exceptions in Dart telugu

preview_player
Показать описание


Рекомендации по теме
Комментарии
Автор

Bro cant find tutorials from 20 to 24 bro

pruithvindra
Автор

void main() {
try {
transferAmount(10000);
} catch (e, s) {
print('did you see what you done $e');
}
}

void transferAmount(int Amount) {
if (Amount < 1000) {
throw wrongBalance();
} else {
print('transfered');
}
}

class wrongBalance implements Exception {
String showError() {
return 'must be greater than 0';
}
}

bro in this code wrongBalance la ela showError() will call without calling externally

sharabugnanesh