Тёмный

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

Vandad Nahavandipoor
Подписаться 45 тыс.
Просмотров 5 тыс.
50% 1

This video is part of the Dart Crash Course playlist on RU-vid. See the entire playlist here: • Dart Crash Course
Welcome to Dart Crash Course. Dart is a beautiful and modern programming language that can be used both for frontend and backend applications. In this course, we will focus on Dart as a programming language without blending in any other frameworks such as Flutter.
In this video we will have a look at exceptions and errors and how they differ in Dart. We will also learn about handling exceptions using try, catch and finally blocks.
Timestamps:
00:00 - Intro
02:04 - Throwing in Class Constructors
07:06 - Custom Exception Class
12:27 - Rethrow
16:04 - Finally
23:18 - Custom Throws Annotation
31:40 - Throwing Errors
35:33 - Capturing Stack Trace
Join the discord group if you have any questions: / discord
The GitHub repository for this course can be found here: github.com/vandadnp/youtube-c...
Join my RU-vid channel to support me: / vandadnp
Also please follow me on Twitter and LinkedIn to stay up to date:
/ vandadnp
/ vandadnp

Наука

Опубликовано:

 

4 авг 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 12   
@blueice1364
@blueice1364 Год назад
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!
@srijanshovit844
@srijanshovit844 Год назад
Loved the depth up to which u covered this topic!! feels like I am getting industry ready!!
@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.
@victordziedzorm
@victordziedzorm Год назад
You are amazing🤩
@okeyshourovroy2769
@okeyshourovroy2769 Год назад
Wow❤️
@minseokjeong1881
@minseokjeong1881 Год назад
DM(Dart Master)
@isurujn
@isurujn Год назад
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 Год назад
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 Год назад
@@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.
@miguelyurivilca6867
@miguelyurivilca6867 Год назад
@d-apps2699
@d-apps2699 Год назад
When to create custom exceptions?
@mohamadeaswy3452
@mohamadeaswy3452 Год назад
Hey I guess if it was explained in Flutter it will be easier to understand
Далее
Китайка Шрек всех Сожрал😂😆
00:20
Викторина от ПАПЫ 🆘 | WICSUR #shorts
00:56
Why The Windows Phone Failed
24:08
Просмотров 211 тыс.
Catch Exceptions in Flutter Like Never Before!
9:02
Просмотров 20 тыс.
Это iPhone 16
0:52
Просмотров 416 тыс.