Join Kevin Skoglund for an in-depth discussion in this video Challenge: Custom exceptions, part of Ruby: Classes and Modules.
- [Instructor] It's time for another coding challenge.…In this assignment you'll get a chance to use what you've…learned about exceptions.…Your challenge is to pick one of the previous challenge…projects that we've worked on in this course.…We had the dice_roller project, we had the radio…and secure radio project, we saw birthdate_analysis,…and we had the to_do_list project.…Pick one of those that you like you can either use…your own existing code or I've provided all of these…projects in the exercise files for convenient reference.…Once you've decided on which one you want to use,…find an appropriate place in that project to use…a custom exception class.…
My advice would be to look for a place where you want…to check for some condition that's exceptional.…So maybe it's an argument that is passed in, that isn't…what you would expect.…Or maybe the result that you get back from something…might be something that you don't expect.…In those cases when something exceptional happens,…that's a good place to raise an exception.…
- Defining a custom class
- Working with instances of a class
- Class and instance attributes and methods
- Class inheritance
- Working with dates and times
- Using modules as namespaces and mixins
- Raising and handling exceptions
Skill Level Beginner
2. Class Attributes and Methods
4. Dates and Times
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.