Exceptions and Errors in Dart - Learn About Exceptions, Errors, Try, Catch, Finally and Much More

  Рет қаралды 5,667

Vandad Nahavandipoor

Vandad Nahavandipoor

Күн бұрын

Пікірлер: 12
@blueice1364
@blueice1364 2 жыл бұрын
This is a much needed topic that everyone seems to avoid or are afraid to go in details. When you work in large production app, it makes your life so much easier. Thanks a lot for gifting us with such in depth and quality content!
@ashiquealimughal7684
@ashiquealimughal7684 Жыл бұрын
Thank you for this amazing tutorial on Exceptions and Errors in Dart! It was very informative and easy to follow. I learned a lot about how to handle exceptions and errors in Dart using try-catch blocks and finally statements. I appreciate your effort in making this tutorial and sharing your knowledge with us. Keep up the great work! My refresher... An EXCEPTION is intended to convey information to the user about a failure that may happen at runtime. Because these exceptions are expected, you should catch them and handle them appropriately. An ERROR object represents a program failure that the programmer should have avoided. Examples include calling a function with invalid arguments or even with the wrong number of arguments or calling it at a time when it is not allowed.
@srijanshovit844
@srijanshovit844 2 жыл бұрын
Loved the depth up to which u covered this topic!! feels like I am getting industry ready!!
@victordziedzorm
@victordziedzorm 2 жыл бұрын
You are amazing🤩
@isurujn
@isurujn 2 жыл бұрын
Hi Vandad, I have a question. Can you please explain what’s the use/advantage in creating a dedicated custom exception class over simply throwing a generic Exception? Seems like it's adding more code but I struggle to see the benefit.
@d-apps2699
@d-apps2699 2 жыл бұрын
I have the same doubt. The only thing I think it helps having our customs expections is that when we use, for example ,Firebase Crashlytics, when our exceptions are thrown it is easy to see which exception is happening since it shows the name of our custom exception, but putting that aside It seems just a lot more code to deal with.
@isurujn
@isurujn 2 жыл бұрын
@@d-apps2699 That's a good point. I just asked ChatGPT and it also answered something along the lines of your thoughts. > Creating a custom exception class allows you to create more informative error messages and handle the error more specifically in your code. By creating a custom exception class, you can define custom properties for the exception object and create methods for handling the exception in a more tailored way. For example, suppose you have a function that performs a calculation and you want to throw an exception if the result of the calculation is invalid. You could create a custom exception class called InvalidCalculationResultException and define a property called result that stores the invalid result. This would allow you to create more informative error messages and handle the error more specifically in your code. In contrast, if you simply throw a generic Exception, you would not have any custom properties or methods available for handling the error in a more tailored way.
@d-apps2699
@d-apps2699 2 жыл бұрын
When to create custom exceptions?
@okeyshourovroy2769
@okeyshourovroy2769 2 жыл бұрын
Wow❤️
@minseokjeong1881
@minseokjeong1881 2 жыл бұрын
DM(Dart Master)
@miguelyurivilca6867
@miguelyurivilca6867 2 жыл бұрын
@mohamadeaswy3452
@mohamadeaswy3452 2 жыл бұрын
Hey I guess if it was explained in Flutter it will be easier to understand
Generics in Dart - Learn How to Write Highly Reusable Code with Generics in Dart
1:07:39
Try this prank with your friends 😂 @karina-kola
00:18
Andrey Grechka
Рет қаралды 9 МЛН
coco在求救? #小丑 #天使 #shorts
00:29
好人小丑
Рет қаралды 120 МЛН
Support each other🤝
00:31
ISSEI / いっせい
Рет қаралды 81 МЛН
Exception Handling in Java Tutorial
13:20
Coding with John
Рет қаралды 435 М.
Catch Exceptions in Flutter Like Never Before!
9:02
Rivaan Ranawat
Рет қаралды 22 М.
The standard library now has all you need for advanced routing in Go.
13:52
WHY IS THE STACK SO FAST?
13:46
Core Dumped
Рет қаралды 188 М.