Skip to content
bbminfo – Learn from Scratch
Subjects Code examples Library reference
Computer Programming Python Java C++ C Go PHP Kotlin Ruby R Scala Groovy

Tutorial menu

Subjects

Computer Programming MathsPlanned ChemistryPlanned

Lesson contents

Programming resources

All languages Code examples Library reference

Programming languages

Python Java C++ C Go PHP Kotlin Ruby R Scala Groovy
Tutorials/Computer Programming/Ruby/Library/Errors and exceptions

Ruby errors and exceptions

Handle invalid entries, missing records, and interrupted work. Follow each failure from the input that triggers it to a response the user can act on.

Errno::ENOENTZeroDivisionErrorDate.iso8601 and ArgumentError

Browse by topic

  • Input and validation5
  • State and collections3
  • Files and streams3

Input and validation

  • Date.iso8601 and ArgumentErrorCheck a delivery date entered on a form
  • Integer with exception: falseReject a mistyped order quantity
  • RegexpErrorValidate a saved product search
  • String#length before slicingRead the depot prefix on a damaged label
  • nil? guardPrint a label when the phone number is missing

State and collections

  • Array#fetch and IndexErrorFind a seat after the coach changes
  • FrozenErrorAdd a stop to a published bus route
  • ZeroDivisionErrorSplit an equipment fee across a class

Files and streams

  • Errno::ENOENTRecover when a receipt is missing
  • IO#read and bytesizeRead a stock count from a short record
  • IOError on a closed streamRead from a finished receipt import

All Ruby library sections

Ruby tutorials

Environment setup› Library reference› Data structures› Code examples›
Advertisements
bbminfo – Learn from Scratch
© 2026 bbminfoArtwork creditsPrivacy policy