slugly 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/slugly/slugly_servlet.rb +11 -10
  2. metadata +4 -4
@@ -9,20 +9,21 @@ class SluglyServlet < WEBrick::HTTPServlet::AbstractServlet
9
9
 
10
10
  def do_POST(request, response)
11
11
  response['Content-Type'] = 'text/plain'
12
-
13
- if not @providers.has_key?(request.path)
14
- response.status = 404
15
- response.body = "Unknown Route"
16
- else
17
- begin
12
+ begin
13
+ if not @providers.has_key?(request.path)
14
+ response.status = 404
15
+ response.body = "Unknown Route"
16
+ else
18
17
  p = @providers[request.path]
19
18
  response.body = @serializer.serialize(p)
20
19
  response.status = 200
21
20
  response['X-Wormly-Version'] = @serializer.version
22
- rescue
23
- response.body = "Internal Server Error"
24
- response.status = 500
25
- end
21
+ end
22
+ rescue Exception => e
23
+ puts e.message
24
+ puts e.backtrace.inspect
25
+ response.body = "Internal Server Error"
26
+ response.status = 500
26
27
  end
27
28
  end
28
29
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: slugly
3
3
  version: !ruby/object:Gem::Version
4
- hash: 27
4
+ hash: 25
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 2
10
- version: 0.0.2
9
+ - 3
10
+ version: 0.0.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Alfred Rossi
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2012-04-04 00:00:00 +00:00
18
+ date: 2012-04-05 00:00:00 +00:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency