From the course: Java Exception Handling
Unlock this course with a free trial
Join today to access over 25,500 courses taught by industry experts.
Challenge: Handle potential runtime exceptions - Java Tutorial
From the course: Java Exception Handling
Challenge: Handle potential runtime exceptions
(electronic music) - [Instructor] So far in this chapter, we have learned about different types of runtime exceptions and how to handle them. We have also learned how to catch and handle generic exceptions. Within our app, we have a total of four end points. The first is the find number endpoint on line 24. The second is the create sequence endpoint on line 44. Then the get sequence endpoint on line 64, and finally the find ratio endpoint on line 81, our first endpoint, the find number endpoint catches any generic exception on line 31 and handles it. There are still three other end points however that can encounter any type of exception and will return an unhelpful error message to the users. For this challenge, you are to update all instances of these endpoints and catch any generic exceptions and return a more helpful message to our users. Feel free to return to the unhandled exceptions video, or refer to lines 31…
Contents
-
-
-
-
-
(Locked)
What are runtime exceptions?2m 28s
-
(Locked)
Runtime exception: Return NumberFormatException to user9m 25s
-
(Locked)
Challenge: Handle an ArithmeticException3m 59s
-
(Locked)
Solution: Handle an ArithmeticException3m 18s
-
(Locked)
Runtime exception: Handling of NullPointerException6m 16s
-
(Locked)
Runtime exception: Unknown runtime exception4m 18s
-
(Locked)
Challenge: Handle potential runtime exceptions1m 19s
-
(Locked)
Solution: Handle potential runtime exceptions4m 1s
-
(Locked)
-