falcon 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +2 -0
- data/lib/falcon/server.rb +12 -3
- data/lib/falcon/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1ad0fb3facc056827b3f6d86b9f7d3dbd8c8e8a7
|
4
|
+
data.tar.gz: 11fd7d0b44d280815bbae15a6278594f788324fd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2dd102500ba56111af17b1237a7b9ac6d0d65428fb58ebb3cb685bef2beb493ab5379310edbad5553470c51eda490f32a4296f563dc7c6d3686287143bf0c077
|
7
|
+
data.tar.gz: 937b96dc8903ec42c5e7572c29c83ff7e2fc18c10eff01a759cb240d8a05fc9a91cef5a620719573583a4af5602d01b11ad6da620f192ae37f70656a3309cb78
|
data/lib/falcon/server.rb
CHANGED
@@ -28,6 +28,10 @@ module Falcon
|
|
28
28
|
@app = app
|
29
29
|
end
|
30
30
|
|
31
|
+
def logger
|
32
|
+
Async.logger
|
33
|
+
end
|
34
|
+
|
31
35
|
def handle_request(request, peer, address)
|
32
36
|
request_path, query_string = request.path.split('?', 2)
|
33
37
|
server_name, server_port = request.headers.fetch('HTTP_HOST', '').split(':', 2)
|
@@ -70,9 +74,14 @@ module Falcon
|
|
70
74
|
end
|
71
75
|
|
72
76
|
return @app.call(env)
|
73
|
-
rescue
|
74
|
-
|
75
|
-
|
77
|
+
rescue => exception
|
78
|
+
logger.error "#{exception.class}: #{exception.message}\n\t#{$!.backtrace.join("\n\t")}"
|
79
|
+
|
80
|
+
return failure_response(exception)
|
81
|
+
end
|
82
|
+
|
83
|
+
def failure_response(exception)
|
84
|
+
[500, {'Content-Type' => 'text/plain'}, ["Request failed due to: #{exception.class}: #{exception.message}"]]
|
76
85
|
end
|
77
86
|
end
|
78
87
|
end
|
data/lib/falcon/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: falcon
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Williams
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-06-
|
11
|
+
date: 2017-06-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: async-http
|