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.
- data/lib/ixtlan/errors/dumper.rb +9 -2
- data/lib/ixtlan/errors/rack.rb +3 -2
- metadata +2 -2
data/lib/ixtlan/errors/dumper.rb
CHANGED
@@ -30,9 +30,16 @@ module Ixtlan
|
|
30
30
|
if defined? ::Slf4r
|
31
31
|
include ::Slf4r::Logger
|
32
32
|
else
|
33
|
-
|
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 ||=
|
42
|
+
@logger ||= Log.new
|
36
43
|
end
|
37
44
|
end
|
38
45
|
|
data/lib/ixtlan/errors/rack.rb
CHANGED
@@ -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.
|
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-
|
12
|
+
date: 2013-02-22 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: slf4r
|