Creating Custom Errors in JavaScript
Did you know that you can create your own custom Error objects in JavaScript?
This can be accomplished with both the older ES5 standard syntax and the newer JS Class syntax.
This video walks through building and handling errors with both approaches and a practical example of a custom Network Error.
Code from video: gist.github.com/prof3ssorSt3v...
Пікірлер: 17
Very good quality of information! Thanks
Great as always.
clean and masterful presentation, bravo
Ok, this is extremely useful. Thanks!
Thanks and welcome back
Thanks for this, I can think of a few places I can use this. 👍🏻
I 100% follow what u do in this video, however only CORS is shown in the console... But luckily this problem is solved now if I use live server.
Thank you! 🙏
Great video. I wonder, if there was a purpose to assign class to variable instead of doing it in more common way like "class NetworkError extends Error {}", thanks?
@SteveGriffith-Prof3ssorSt3v3
Жыл бұрын
No reason. The two are nearly interchangeable
I'm not shure that I understant the part at 3:27 correctly. Invoking the SteveError-Function with the new-operator seems obsolete since the function returns an object anyway.
@rmnkot
Жыл бұрын
I've got the same thoughts.
Sir how many more lessons (vedioes ) are there in this series ??
@SteveGriffith-Prof3ssorSt3v3
Жыл бұрын
Which series are you referring to? It is in 4 different playlists. A couple of the playlists have over 200 videos
@skandaedits2915
Жыл бұрын
@@SteveGriffith-Prof3ssorSt3v3 sir iam recovering to this whole 200+ javascript lessons
you should be a programmer when you grow up
@SteveGriffith-Prof3ssorSt3v3
Жыл бұрын
😎