6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
# File 'lib/rack-idempotent/default_rescue.rb', line 6
def call(options={})
exception = options[:exception]
status = nil
method = nil
if exception
return IDEMPOTENT_ERROR_CLASSES.include?(exception.class)
end
unless status && method
status = options[:response].status
method = options[:request].env["REQUEST_METHOD"]
end
if method == "GET"
GET_RETRY_HTTP_CODES.include?(status)
elsif method == "POST"
POST_RETRY_HTTP_CODES.include?(status)
else
false
end
end
|