Module: TinyPng::ExceptionHandling

Included in:
Client
Defined in:
lib/tiny_png/exception_handling.rb

Instance Method Summary collapse

Instance Method Details

#raise_exception(exception, message) ⇒ Object

If exceptions are suppressed, just return false. Otherwise, raise the given exception

Raises:

  • (exception)


5
6
7
8
# File 'lib/tiny_png/exception_handling.rb', line 5

def raise_exception exception, message
  return false if @options[:suppress_exceptions]
  raise exception, message
end