👉 NEW React & Next.js Course: bytegrad.com/courses/professional-react-nextjs
@ismoiljonabduqahhorov5825 Жыл бұрын
Hello ByteGrad I was struggling with error handling and your tutorial really helped dealing with errors loved your content good luck
@renjithpn20027 ай бұрын
This is art, loved it 🙂
@elenamikhaylova50868 ай бұрын
Thank you for explaining this well, i have banged my head on JS error handling for so long
@vincenzocristiano135 Жыл бұрын
This is pure gold! Thanks a lot!!!
@honkhonkv223610 ай бұрын
Hello, awesome channel for a noob like me! I was wondering, at 10:42 in our utility function couldn't we just omit to type the message as string and instead in the return do something like "return message.toString()" ?
@MailarYT Жыл бұрын
Your really good explaining, keep going Cheers
@loydcose2780 Жыл бұрын
This is awesome!
@solosdev69469 ай бұрын
Thanks finding a solution for this :D
@grugbrain Жыл бұрын
That's exactly how I handle request errors in our projects. 😅 Those Python develelopers cannot agree with Java developers on error response, and they both think it is easy to handle those errors in the client side.
@Bravin_Joshua2 ай бұрын
Nice lesson on error handling though
@СергійК-ш4у Жыл бұрын
thank you for sharing this topic
@npaul1440 Жыл бұрын
Your tutorials and content are A Class. Just get a better microphone if possible. Thanks
@mujibulhaquetanim Жыл бұрын
yap, sounds is too low.
@bheemkumarthami11 ай бұрын
Thanks a lot. keep going
@meka4996 Жыл бұрын
Amazing! Thanks
@SyTruong-d3d Жыл бұрын
We still not consider the case where "message" is also an object
@antonapalanyuk338 Жыл бұрын
What about to save mark as 'any' and use following: console.log(error?.message || error?.stack || error); It is suitable for all error data types
@andrevinsky2 ай бұрын
Wrapping an unknown in a String() call does not actually constitute casting, strictly speaking, as it’s either this or this: as string. Wrapping stuff in a String() call actually replaces the value of the unknown with a string equivalent. Not casting That note aside, I really like videos. Appreciate the effort
I would write ... else if (error && typeof error === "object" && "message in error && typeof error.message === "string") { ... If there is a message in an error object but it isn't a string, it should possibly use the default error message instead.
@ByteGrad Жыл бұрын
Good point
@AriadyPutra7 ай бұрын
message = `${error}`
@supremecommanderz7 ай бұрын
just type and be happy: error?.message??'errors happens'
@deatho0ne587 Жыл бұрын
What if error.message is is an object, HTML, etc... Casting to string then would not be really safe.
@ByteGrad Жыл бұрын
Good point
@deatho0ne587 Жыл бұрын
It is good for another video about TypeGaurds maybe.
@ciach0_ Жыл бұрын
Then that would be [object Object]
@deatho0ne587 Жыл бұрын
The thing is even if it is an object should you trust it for display purposes?
@charuwaka111 ай бұрын
use zod
@silenthooman Жыл бұрын
the fn is async, and he used the then, man just use await