Module: Fetcher::Notion::Helper

Defined in:
lib/bas/fetcher/notion/helper.rb

Overview

Provides common fuctionalities along the Notion domain.

Class Method Summary collapse

Class Method Details

.validate_response(response) ⇒ Object



9
10
11
12
13
14
15
16
17
18
# File 'lib/bas/fetcher/notion/helper.rb', line 9

def self.validate_response(response)
  case response.status_code
  when 401
    raise Exceptions::Notion::InvalidApiKey, response.message
  when 404
    raise Exceptions::Notion::InvalidDatabaseId, response.message
  else
    response
  end
end