0 votes
in Ruby by
Explain the use of retry statement in Ruby?

1 Answer

0 votes
by

Usaually in a rescue clause, the exception is captured and code resumes after begin block. Using retry statement, the rescue block code can be resumed from begin after capturing an exception.

Syntax:

begin  

code....  

rescue  

# capture exceptions  

retry # program will run from the begin block  

end  

Related questions

0 votes
asked Nov 11, 2021 in Ruby by SakshiSharma
0 votes
0 votes
asked Nov 14, 2021 in Ruby by sharadyadav1986
...