Sha256: c8570fa0c2b68fbb200effa1e362bac4db0004b66ab8f9296210aaef46657da2

Contents?: true

Size: 288 Bytes

Versions: 2

Compression:

Stored size: 288 Bytes

Contents

module Sheetsu
  class ErrorHandler
    include HTTParty

    def self.response_code_to_exception(response)
      case response.code
      when 404
        fail Error, 'API with given URL is not found'
      when 500
        fail Error, 'Something goes wrong'
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
sheetsu-0.1.1 lib/sheetsu/errors.rb
sheetsu-0.1.0 lib/sheetsu/errors.rb