A Rubyist's Walk Along the C-side (Part 8): Exceptions

In the previous article, you saw TypedData objects, a type unique to the Ruby C API. In this article, we’ll look at how to raise errors and rescue from errors.Raising errors You’ve already seen one way to raise errors in part 4. The Check_Type function guards that a variable is of a particular Ruby type and will raise a TypeError otherwise.The Ruby C API provides builtin errors as global variables. The builtin errors are prefixed with rb_e (e.g. rb_eRuntimeError for the RuntimeError exception). This was covered in more detail in part 4.
A Rubyist's Walk Along the C-side (Part 8): Exceptions #ruby #rubydeveloper #rubyonrails https://rubyonrails.ba/single/a-rubyist-s-walk-along-the-c-side-part-8-exceptions

Nezir Zahirovic

Contractor Ruby On Rails (8+ years) / MCPD .Net / C# / Asp.Net / CSS / SQL / (11 years)

related articles