What way is true?

Y

Yan Bernatsky

Hello.

I have some method. What is preferable: use raise and rescue or use
return?

def(a, b)
# ...
rescue "some error" if some_is_wrong

rescue
another_method
false
end

or

def(a, b)
# ...
if some_is_wrong
another_method
false
end
end
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,141
Messages
2,570,817
Members
47,362
Latest member
ChandaWagn

Latest Threads

Top