we_bridge-exceptions 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/we_bridge/exceptions.rb +8 -0
- data/lib/we_bridge/exceptions/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: 02fd63c055c6a61a4a0a53ccb213ade87677ad68
|
4
|
+
data.tar.gz: 742a29e43e4daa61947d67bd93e5076942bca2fe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 89ca190a89438b465d91db8c487c0417fd17e765545c2a3aaabab1f9d09067db32c5a6e613d40584d7ba1c0c4225645526950a73dd62ba9ef2fcef10143421a4
|
7
|
+
data.tar.gz: dd235565a8d9b8c1cd3f9c5423db3147ba5eadc2c584a975e6baa66850e310f25072372542d3c1c0a159ee2c0c9b405475b891ddc1441fd30f0341addb760f14
|
data/lib/we_bridge/exceptions.rb
CHANGED
@@ -57,7 +57,15 @@ module WeBridge
|
|
57
57
|
end
|
58
58
|
|
59
59
|
def handle_error(exception , status_code)
|
60
|
+
self.logging_on_handle_error(exception , status_code)
|
61
|
+
self.render_error(status_code)
|
62
|
+
end
|
63
|
+
|
64
|
+
def logging_on_handle_error(exception , status_code)
|
60
65
|
logger.info "Rendering #{status_code} with exception: #{exception.message}" if exception
|
66
|
+
end
|
67
|
+
|
68
|
+
def render_error(status_code)
|
61
69
|
render file: WeBridge::Exceptions.error_template_file_path(status_code), status: status_code, content_type: 'text/html'
|
62
70
|
end
|
63
71
|
|