#94 Handling Not Found Errors | Error Handling in Express | A Complete NODE JS Course

Поделиться
HTML-код
  • Опубликовано: 25 ноя 2024

Комментарии • 12

  • @bolooemmanuel6651
    @bolooemmanuel6651 10 месяцев назад +4

    I'm so pained that I'm just seeing your vids. Custom error brought me here but so far you are one of my fav tutors sir.

  • @DarkzarichV2
    @DarkzarichV2 4 месяца назад

    Here is the thing tho, if you use asyncErrorHandler function which handles all rejections you don't really need next(error) instead you can throw the error and it will be caught by the middleware and then passed to the middleware that handles errors

  • @josephuzuegbu7431
    @josephuzuegbu7431 Год назад

    I love this tutorial. However, i was thinking we can throw an error if we can find the movie so that the wrapper function can handle it for us. Thanks for this tutorial

  • @parth_patel2933
    @parth_patel2933 6 месяцев назад

    6:40 we can also throw a new CustomError as an error link this => throw new CustomError({ message: "Movie with that ID is not found!", statusCode: 404 });
    this will handle by asyncErrorHandler function

  • @AjayCoding
    @AjayCoding Год назад +1

    ❤❤

  • @dicksoncyprian9511
    @dicksoncyprian9511 8 дней назад

    error handling so difficult to understad

  • @shubhamgoswami3722
    @shubhamgoswami3722 Год назад

    Why did you applied the asynErrorHandler in updateMovie

    • @DerekBaker90
      @DerekBaker90 8 месяцев назад

      So you can move all the catch(error) handling from your async functions to the asyncErrorHandler, instead of repeating the same thing in each async function

    • @inspireVoyage123
      @inspireVoyage123 6 месяцев назад

      Async is always returning promises .. and promises have then and catch properties .... So we are thinking in such a way that we don't have to repeat a code .. so just for that we created a function which takes function as a parameter. And will be called when we do request .. and the reason is .. we are calling the function using calback .. and when express catch some error that callback will be triggered and then called ...and there you see we used next(err), that will trigger the error handling middle ware .. and we can get response to json format... If error occurs

  • @inspireVoyage123
    @inspireVoyage123 6 месяцев назад

    I dont know either this guy copied the content of jonas schmedman or jonas did copy... It is exactly the same that i learned in the paid course

    • @anuragh3
      @anuragh3 5 месяцев назад

      yeah, this guy copied from jonas

  • @hassannouri9796
    @hassannouri9796 2 месяца назад

    ❤❤❤