tzispa 0.4.7 → 0.4.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/tzispa/app.rb +2 -2
- data/lib/tzispa/controller/base.rb +2 -2
- data/lib/tzispa/http/context.rb +2 -2
- data/lib/tzispa/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d63bac87f861d60db3bd3239cfd7feab000ba0d7
|
4
|
+
data.tar.gz: 893406a35ea1ea3ee6653f14b10f9061ba937371
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f28e6825678907a553d98243d9f4dad1778507a22612da51c51a3bdb4f3b4bb8d5d065382d37139e0e4f80bf91ab6bd882262e822273c8f3fd79d7925322c769
|
7
|
+
data.tar.gz: 9793576f8b9aa3409e1970d3303c6f09df2b22a4b3598b454a958cfe8ac273a19a13cbc264124f8515f97bde981305afc6bea86fe2ca0a7699a85a0986fe5946
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,10 @@ Tzispa
|
|
2
2
|
|
3
3
|
General purpose web framework
|
4
4
|
|
5
|
+
## v0.4.8
|
6
|
+
- rename context method error to error_500 for conflict with response helper error method
|
7
|
+
- pass response.status to error_page in controller base class
|
8
|
+
|
5
9
|
## v0.4.7
|
6
10
|
- remove browser detection obsolete code
|
7
11
|
- remake app error handling and reporting
|
data/lib/tzispa/app.rb
CHANGED
@@ -83,9 +83,9 @@ module Tzispa
|
|
83
83
|
rescue StandardError, ScriptError => ex
|
84
84
|
logger.error "#{ex.message}\n#{ex.backtrace.map { |trace| "\t #{trace}" }.join('\n') if ex.respond_to?(:backtrace) && ex.backtrace}"
|
85
85
|
if config.developing
|
86
|
-
context.
|
86
|
+
context.error_500 error_report(ex)
|
87
87
|
else
|
88
|
-
context.
|
88
|
+
context.error_500 error_page(domain)
|
89
89
|
end
|
90
90
|
context.response.finish
|
91
91
|
end
|
@@ -12,7 +12,7 @@ module Tzispa
|
|
12
12
|
extend Forwardable
|
13
13
|
|
14
14
|
attr_reader :context
|
15
|
-
def_delegators :@context, :request, :response, :config
|
15
|
+
def_delegators :@context, :request, :response, :config
|
16
16
|
|
17
17
|
def initialize(callmethod=nil)
|
18
18
|
@callmethod = callmethod
|
@@ -31,7 +31,7 @@ module Tzispa
|
|
31
31
|
send "#{@callmethod}"
|
32
32
|
}
|
33
33
|
response.status = status if status.is_a?(Integer)
|
34
|
-
|
34
|
+
context.error_500 context.app.error_page(context.app.domain, status: response.status) if (response.client_error? || response.server_error?)
|
35
35
|
end
|
36
36
|
|
37
37
|
|
data/lib/tzispa/http/context.rb
CHANGED
@@ -38,12 +38,12 @@ module Tzispa
|
|
38
38
|
router_params&.fetch(:layout, nil)
|
39
39
|
end
|
40
40
|
|
41
|
-
def
|
41
|
+
def error_500(body)
|
42
42
|
500.tap { |code|
|
43
43
|
response.status = code
|
44
44
|
response.body = body
|
45
45
|
}
|
46
|
-
end
|
46
|
+
end
|
47
47
|
|
48
48
|
def set_last_access
|
49
49
|
session[SESSION_LAST_ACCESS] = Time.now.utc.iso8601
|
data/lib/tzispa/version.rb
CHANGED