In case the custom handler does not take effect, add @Order(-2) on your handler class to give it a higher priority than the DefaultErrorWebExceptionHandler.
this saved me a lot of trial and error, thanks. But quick question, instead of having one fixed status of bad request in global error attributes, how can I make it dynamic so when I throw a new exception, I can pass along the status I want with it, be it 404 not found or 401 unauthorized
@@Javatechie thanks for the reply, I've read on the annotation and still a little bit confused. After putting the @ResponseStatus on the different exception classes, in the getErrorAttributes(), we are hardcoding the fields to be returned, how can I make those fields change their values i.e I added a statusCode field that I want to display with my error response, how can I update it in getErrorAttributes() based off what exception is being hit?
@@Javatechie I have multiple exception classes with different responseStatuses, but check 17:35, it'll always return bad request regardless of which exception class it hits. So in getErrorAttributes() (check from 24:45) , I added an httpStatus field to my map, that I now get in the exceptionHandler to set the status. So my question now is, how to I change the httpStatus field in getErrorAttributes() to change depending on which exception is hit in the application
Thanks a lot , it was really helpful also can you help in writing the unit test cases of these 2 classes that exception handler and global error attributes as for my project only 3% coverage is there for these 2 classes
I don’t know how you watch the video in mobile or pc 🖥️, the video resolution set to 1080 HD I can able to watch clearly in my mobile and laptop please check your internet connectivity and also increase the resolution in TH-cam. I hope you are aware about this process so please try and let me know if any further assistance required
Hello buddy apologies for this please increase the resolution. Since this is the old video resolution Ava up to 720 HD. All recent videos are available in 4k
Ahhhhhhhhh, finally! Exception handling hs been Hard for me while learning functional programming. Thanks!!
Finally! Best example. Best of all the best
Nicely done! Great explanation as usual! Thank you!
Great Job. Thanks for share your knowledge.
You are seriously great.
Hats off.
Great tuto!! thanks man!
Thank you man ! Great video.
Superb brother as usual 👏 👌
In case the custom handler does not take effect, add @Order(-2) on your handler class to give it a higher priority than the DefaultErrorWebExceptionHandler.
You are awesome sir
Super
Great.In the real time every one use storedprocedure call for database. Can we call sp from reactive program?
I guess yes we can but let me check
Request you to please make some content explaining Spring Api Gateway vs Kubernets Ingress.
Which one should we use?
Or can we use both together ?
Thanks you are the best... Please can you do a video using hibernate with spring webflux 🙏
Hibernate?
@@Javatechie yes please. reactive hibernate
Hi, It is looking bit tough then our traditional rest endpoints.
Could you please suggest some topic to learn this Functional Programming ?
I would suggest you to be a master in java 8 before start reactive functional programming
@@Javatechie Okay, but I am already having knowledge of Java 8.
Then you can easily grab a reactive functional style of coding. Keep practicing
@@Javatechie Okay, Thank you.
this saved me a lot of trial and error, thanks. But quick question, instead of having one fixed status of bad request in global error attributes, how can I make it dynamic so when I throw a new exception, I can pass along the status I want with it, be it 404 not found or 401 unauthorized
You can use @ResponseStatus annotations
@@Javatechie thanks for the reply, I've read on the annotation and still a little bit confused. After putting the @ResponseStatus on the different exception classes, in the getErrorAttributes(), we are hardcoding the fields to be returned, how can I make those fields change their values i.e I added a statusCode field that I want to display with my error response, how can I update it in getErrorAttributes() based off what exception is being hit?
No buddy how it's hardcoded . To make it dynamic better to create multiple exception class use one for 400 and different for 500 like that
@@Javatechie I have multiple exception classes with different responseStatuses, but check 17:35, it'll always return bad request regardless of which exception class it hits. So in getErrorAttributes() (check from 24:45) , I added an httpStatus field to my map, that I now get in the exceptionHandler to set the status. So my question now is, how to I change the httpStatus field in getErrorAttributes() to change depending on which exception is hit in the application
Can you please tell me how can I validate the model data in reactive programming
Thanks a lot , it was really helpful also can you help in writing the unit test cases of these 2 classes that exception handler and global error attributes as for my project only 3% coverage is there for these 2 classes
Can you also explain about both WebClient and rest template which is used to call from one rest service to another rest service
Could you please make a a video on ReactiveSecurityContextHolder
Okay i will do that
Not getting how to handle multiple custom exceptions
cloud u give me your font settings? Thanks!
Not a single word from your screen is readable
I don’t know how you watch the video in mobile or pc 🖥️, the video resolution set to 1080 HD I can able to watch clearly in my mobile and laptop please check your internet connectivity and also increase the resolution in TH-cam. I hope you are aware about this process so please try and let me know if any further assistance required
this shows how slow working with java is
It looks like you are not much aware about benefits of java please check pros and cons of it
Video quality not good.
Hello buddy apologies for this please increase the resolution. Since this is the old video resolution Ava up to 720 HD.
All recent videos are available in 4k