Identifies rescue block as empty when returning [] #4

Closed
dkubb opened this Issue Oct 17, 2009 · 2 comments

Comments

Projects
None yet
3 participants

dkubb commented Oct 17, 2009

I have the following code in a project, and Roodi was returning the error "Rescue block should not be empty":

def directory_listing
  @path.dirname.children
rescue Errno::ENOENT
  []
end

If I add an explicit return, or change [] to Array.new the error goes away.

Also, roodi says the same on

    def process_text(text)
      processed_text = text.some.processing.on.it
    rescue
      text
    end

May be, I cannot return the same parameter, I recieved as the argument? Or what?

Contributor

evjan commented Aug 16, 2013

Thanks for reporting!

Fixed in 0bfbc34

evjan closed this Aug 16, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment