ixtlan-error-handler 0.4.0 → 0.4.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -30,9 +30,16 @@ module Ixtlan
30
30
  if defined? ::Slf4r
31
31
  include ::Slf4r::Logger
32
32
  else
33
- require 'logger'
33
+ class Log
34
+ def info( msg )
35
+ puts "[Ixtlan::Errors] #{msg}"
36
+ end
37
+ def warn( msg )
38
+ warn "[Ixtlan::Errors] #{msg}"
39
+ end
40
+ end
34
41
  def logger
35
- @logger ||= Logger.new( STDOUT )
42
+ @logger ||= Log.new
36
43
  end
37
44
  end
38
45
 
@@ -19,6 +19,7 @@
19
19
  # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
20
20
  #
21
21
  require 'rack/request'
22
+ require 'rack/utils'
22
23
  module Ixtlan
23
24
  module Errors
24
25
  class Rack
@@ -67,12 +68,12 @@ module Ixtlan
67
68
  @dumper.dump( e, env, {}, req.session, req.params )
68
69
  end
69
70
  if @dump_to_console
70
- warn "[Ixtlan] #{e.class}: #{e.message}"
71
+ warn "[Ixtlan::Errors] #{e.class}: #{e.message}"
71
72
  warn "\t" + e.backtrace.join( "\n\t" ) if e.backtrace && status >= 500
72
73
  end
73
74
  [ status,
74
75
  {'Content-Type' => 'text/plain'},
75
- [''] ]
76
+ [ ::Rack::Utils::HTTP_STATUS_CODES[ status ] ] ]
76
77
  end
77
78
  end
78
79
 
metadata CHANGED
@@ -2,14 +2,14 @@
2
2
  name: ixtlan-error-handler
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.4.0
5
+ version: 0.4.1
6
6
  platform: ruby
7
7
  authors:
8
8
  - Christian Meier
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-01-30 00:00:00.000000000 Z
12
+ date: 2013-02-22 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: slf4r