0

I wonder if there is a way to rescue null as we do rescue nil in Ruby?

I know rescue nil and tertiary aren't good practice, but I'm still a bit old school.

Thanks

Dr Linh Chi Nguyen
  • 1,063
  • 1
  • 9
  • 17
  • 2
    Do you just mean an empty `catch` block? – SomeBody Jul 16 '20 at 07:57
  • 1
    Can you give an example of exactly what it is you want to do? – Kjartan Jul 16 '20 at 08:04
  • 3
    "as we do rescue nil in Ruby?" since not all of the C# programmers here automatically know Ruby, it would be good if you could describe what "rescue" actually does there. A description would help us to find a proper equivalent if it exists – Mong Zhu Jul 16 '20 at 08:04
  • 1
    @MongZhu, should we add tag `ruby` to question? Or would c# tag annoy ruby experts as much as ruby in question us? – Sinatr Jul 16 '20 at 08:08
  • @Sinatr :D I had the same thought. But I hesitated to add the tag. Without a proper description is search for a possible equivalent is hopeless, unless someone comes along who knows both languages. Linh if you want to speed up things provide a description – Mong Zhu Jul 16 '20 at 08:11
  • 1
    [this answer](https://stackoverflow.com/questions/2191632/begin-rescue-and-ensure-in-ruby/2192010) looks promising – Mong Zhu Jul 16 '20 at 08:13

0 Answers0