Category Archives: Ruby Exception Handling

Ruby Exception Handling

Ruby Exception Handling: InvalidByteSequenceError

Moving right along through our in-depth Ruby Exception Handling series, today we’re going to examine the InvalidByteSequenceError. An InvalidByteSequenceError is raised when utilizing Ruby’s internal Encoding or Stringmethods to transcode a string that contains an invalid byte for the particular encoding converters being utilized. Throughout this article we’ll examine the InvalidByteSequenceError class, look at where it sits within Ruby’s Exception class hierarchy, and also… continue reading →

Ruby Exception Handling

Ruby Exception Handling: CompatibilityError

As we continue to make our way through the expansive Ruby Exception Handling series, today we’ll be taking a closer look at the CompatibilityError. CompatibilityErrors appear when dealing with encoding in Ruby, and specifically when attempts are made to compare two encoded values which have incompatible encoding types. Throughout this article we’ll delve into the… continue reading →

Ruby Exception Handling

Ruby Exception Handling: ConverterNotFoundError

As our exploration through the Ruby Exception Handling series continues, today we’ll be examining the ConverterNotFoundError. ConverterNotFoundErrors appear in Ruby when attempting to use any of the variety of transcoding methods provided by Ruby, but in doing so, passing an invalid converter that Ruby isn’t aware of. In the meat of this article we’ll explore… continue reading →

Ruby Exception Handling

Ruby Exception Handling: UncaughtThrowError

The steady journey through our extensive Ruby Exception Handling series continues. Today we’ll be taking a closer look at the UncaughtThrowError. UncaughtThrowError is a descendant class of the ArgumentError, which is, in turn, a descendant of the StandardError superclass we all know and love. UncaughtThrowError is, as the name implies, raised when a throw is called but not properly caught by an… continue reading →

Ruby Exception Handling

Ruby Exception Handling: SignalException

Next on the docket for our Ruby Exception Handling series, we’re taking a look at the SignalException class. SignalException is a subclass descendant of the Exception superclass, and occurs when a process monitored by Ruby receives a signal via the operating system. In this post we’ll explore the SignalException class, examining where it lands within Ruby’s Exception class hierarchy, how to handle SignalException errors,… continue reading →

Ruby Exception Handling

Ruby Exception Handling: Interrupt

Today as we continue our journey through the wide world of Ruby Exception Handling, we’re going to examine the Interrupt exception class. Interrupt is a subclass descendant of the Exception superclass, and occurs when a specific interrupt signal is received by the active Ruby process, such as when the user manually halts via Ctrl-C. In this article we’ll… continue reading →

Ruby Exception Handling

Ruby Exception Handling: StandardError — default for rescue

This is an exciting day in the life of our Ruby Exception Handling series, as we tackle the big daddy of all Ruby exceptions, the StandardError. StandardError is a superclass with many exception subclasses of its own, but like all errors, it descends from the Exception superclass. StandardErrors occur anytime a rescue clause catches an exception without an explicit Exception class specified. In this post… continue reading →