Skip to content

Instantly share code, notes, and snippets.

@gr33n7007h
Created February 20, 2020 01:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gr33n7007h/b7ef03c5cce64e34d6732c47d5d7e081 to your computer and use it in GitHub Desktop.
Save gr33n7007h/b7ef03c5cce64e34d6732c47d5d7e081 to your computer and use it in GitHub Desktop.
def fake_response
%i(ok warn fatal critical).sample
end
begin
msg = fake_response
if msg == :warn
raise
end
rescue RuntimeError
sleep(5)
retry
else
p msg
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment