module Rester::Errors

Public Class Methods

throw_error!(error, message = nil) click to toggle source

Throws an error instead of raising it, which is more performant. Must be caught by an appropriate error handling wrapper.

# File lib/rester/errors.rb, line 7
def throw_error!(error, message = nil)
  error = error.new(message) if error.is_a?(Class)
  throw :error, error
end