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

  • @justfair3374
    @justfair3374 Жыл бұрын

    Very good quality of information! Thanks

  • @rishavmasih9450
    @rishavmasih9450 Жыл бұрын

    Great as always.

  • @gfilippou
    @gfilippou Жыл бұрын

    clean and masterful presentation, bravo

  • @naraksama3903
    @naraksama3903 Жыл бұрын

    Ok, this is extremely useful. Thanks!

  • @allezzthepunk
    @allezzthepunk Жыл бұрын

    Thanks and welcome back

  • @nChauhan91
    @nChauhan91 Жыл бұрын

    Thanks for this, I can think of a few places I can use this. 👍🏻

  • @leeeric6292
    @leeeric629211 ай бұрын

    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.

  • @ofeenee
    @ofeenee Жыл бұрын

    Thank you! 🙏

  • @rmnkot
    @rmnkot Жыл бұрын

    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

    @SteveGriffith-Prof3ssorSt3v3

    Жыл бұрын

    No reason. The two are nearly interchangeable

  • @m0ZZaik
    @m0ZZaik Жыл бұрын

    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

    @rmnkot

    Жыл бұрын

    I've got the same thoughts.

  • @skandaedits2915
    @skandaedits2915 Жыл бұрын

    Sir how many more lessons (vedioes ) are there in this series ??

  • @SteveGriffith-Prof3ssorSt3v3

    @SteveGriffith-Prof3ssorSt3v3

    Жыл бұрын

    Which series are you referring to? It is in 4 different playlists. A couple of the playlists have over 200 videos

  • @skandaedits2915

    @skandaedits2915

    Жыл бұрын

    @@SteveGriffith-Prof3ssorSt3v3 sir iam recovering to this whole 200+ javascript lessons

  • @whatthefunction9140
    @whatthefunction9140 Жыл бұрын

    you should be a programmer when you grow up

  • @SteveGriffith-Prof3ssorSt3v3

    @SteveGriffith-Prof3ssorSt3v3

    Жыл бұрын

    😎