167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
|
# File 'lib/stream/client.rb', line 167
def call(env)
@app.call(env).on_complete do |response|
case response[:status].to_i
when 200..203
return response
when 401
raise StreamApiResponseException, error_message(response, 'Bad feed')
when 403
raise StreamApiResponseException, error_message(response, 'Bad auth/headers')
when 404
raise StreamApiResponseException, error_message(response, 'url not found')
when 204...600
raise StreamApiResponseException, error_message(response, _build_error_message(response.body))
end
end
end
|