Sha256: 04d79c03e80d33ce10491234ea51ddc4058a2404516d9d7fdf25aa63bd40a151

Contents?: true

Size: 744 Bytes

Versions: 19

Compression:

Stored size: 744 Bytes

Contents

module ForestLiana
  module Ability
    module Fetch
      def get_permissions(route)
        begin
          response = ForestLiana::ForestApiRequester.get(route)

          if response.is_a?(Net::HTTPOK)
            JSON.parse(response.body)
          else
            raise "Forest API returned an #{ForestLiana::Errors::HTTPErrorHelper.format(response)}"
          end
        rescue => exception
          FOREST_REPORTER.report exception
          FOREST_LOGGER.error 'Cannot retrieve the permissions from the Forest server.'
          FOREST_LOGGER.error 'Which was caused by:'
          ForestLiana::Errors::ExceptionHelper.recursively_print(exception, margin: ' ', is_error: true)
          nil
        end
      end
    end
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
forest_liana-8.0.14 app/services/forest_liana/ability/fetch.rb
forest_liana-8.0.13 app/services/forest_liana/ability/fetch.rb
forest_liana-8.0.12 app/services/forest_liana/ability/fetch.rb
forest_liana-8.0.11 app/services/forest_liana/ability/fetch.rb
forest_liana-8.0.10 app/services/forest_liana/ability/fetch.rb
forest_liana-8.0.9 app/services/forest_liana/ability/fetch.rb
forest_liana-8.0.8 app/services/forest_liana/ability/fetch.rb
forest_liana-8.0.7 app/services/forest_liana/ability/fetch.rb
forest_liana-8.0.6 app/services/forest_liana/ability/fetch.rb
forest_liana-8.0.5 app/services/forest_liana/ability/fetch.rb
forest_liana-8.0.4 app/services/forest_liana/ability/fetch.rb
forest_liana-8.0.3 app/services/forest_liana/ability/fetch.rb
forest_liana-8.0.2 app/services/forest_liana/ability/fetch.rb
forest_liana-8.0.1 app/services/forest_liana/ability/fetch.rb
forest_liana-8.0.0 app/services/forest_liana/ability/fetch.rb
forest_liana-8.0.0.beta.4 app/services/forest_liana/ability/fetch.rb
forest_liana-8.0.0.beta.3 app/services/forest_liana/ability/fetch.rb
forest_liana-8.0.0.beta.2 app/services/forest_liana/ability/fetch.rb
forest_liana-8.0.0.beta.1 app/services/forest_liana/ability/fetch.rb