Module: GdsApi::ExceptionHandling

Included in:
AssetManager, BusinessSupportApi, ContentApi, GovUkDelivery, JsonClient, Mapit, Panopticon
Defined in:
lib/gds_api/exceptions.rb

Instance Method Summary collapse

Instance Method Details

#ignoring(exception_or_exceptions, &block) ⇒ Object



31
32
33
34
35
# File 'lib/gds_api/exceptions.rb', line 31

def ignoring(exception_or_exceptions, &block)
  yield
rescue *exception_or_exceptions
  # Discard the exception
end

#ignoring_missing(&block) ⇒ Object



37
38
39
# File 'lib/gds_api/exceptions.rb', line 37

def ignoring_missing(&block)
  ignoring([HTTPNotFound, HTTPGone], &block)
end