Skip to content

Commit a64a03d

Browse files
committed
ServiceTimeout instead of Timeout::Error
1 parent 36b3806 commit a64a03d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

github-services.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,15 @@
4545
end
4646

4747
module GitHub
48+
class ServiceTimeout < Timeout::Error
49+
end
50+
4851
def service(name)
4952
post "/#{name}/" do
5053
begin
5154
data = JSON.parse(params[:data])
5255
payload = JSON.parse(params[:payload])
53-
Timeout.timeout(20) { yield data, payload }
56+
Timeout.timeout(20, ServiceTimeout) { yield data, payload }
5457
rescue => boom
5558
# redact sensitive info in hook_data hash
5659
hook_data = data || params[:data]

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy