exception_handler 0.2.6 → 0.2.7
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/README.md +51 -14
- data/app/views/exception_handler/exception/show.html.haml +1 -1
- data/app/views/layouts/error.html.haml +2 -2
- data/lib/exception_handler/config.rb +1 -1
- data/lib/exception_handler/version.rb +1 -1
- data/lib/generators/templates/exception_handler.rb +1 -1
- data/readme/500.png +0 -0
- data/readme/db.png +0 -0
- data/vendor/assets/images/exception_handler/alert.png +0 -0
- data/vendor/assets/images/exception_handler/contact/facebook.png +0 -0
- data/vendor/assets/images/exception_handler/contact/fusion.png +0 -0
- data/vendor/assets/images/exception_handler/contact/linkedin.png +0 -0
- data/vendor/assets/images/exception_handler/contact/twitter.png +0 -0
- data/vendor/assets/images/exception_handler/contact/youtube.png +0 -0
- metadata +9 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dcd9b5923dc39f43b43beb02ee3004ea850f3103
|
4
|
+
data.tar.gz: f9c1174fe636735617607af47e51cf5b43eb178b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b85c858abce97e7937823922a0981caae1b3dbdd0ae639a52431b4a3f139a7ee2661adf38307846829b4a6d7d293be26ada2546d15711f6632892d77f7fff69a
|
7
|
+
data.tar.gz: a3705b63eb93501674d6dd829c98bee369ef70911377177c742c7293d81e737cd4e409d4d22554076b79241eeaeafbcc74b2505b49acdc264504d4fd13d60c93
|
data/README.md
CHANGED
@@ -7,7 +7,7 @@
|
|
7
7
|
[](https://travis-ci.org/richpeck/exception_handler)
|
8
8
|
|
9
9
|
|
10
|
-
[**ExceptionHandler** Rails Gem](https://rubygems.org/gems/exception_handler) (adapted from [this tutorial](https://gist.github.com/wojtha/8433843) &
|
10
|
+
[**ExceptionHandler** Rails Gem](https://rubygems.org/gems/exception_handler) (adapted from [this tutorial](https://gist.github.com/wojtha/8433843) & [this tutorial](http://www.sharagoz.com/posts/1-rolling-your-own-exception-handler-in-rails-3))
|
11
11
|
|
12
12
|
Works with the [`config.exceptions_app`](http://guides.rubyonrails.org/configuring.html#rails-general-configuration) hook in Rails' middleware stack:
|
13
13
|
|
@@ -18,13 +18,55 @@ Works with the [`config.exceptions_app`](http://guides.rubyonrails.org/configuri
|
|
18
18
|
|
19
19
|
####Custom Error Pages
|
20
20
|
|
21
|
-
You can
|
21
|
+
You can deploy *custom error pages*. These allow you to serve your own design error pages in production; showing both the error, and the problem. This is a big step forward from the standard Rails error reporting facility
|
22
22
|
|
23
|
+
There are two types of error page:
|
23
24
|
|
25
|
+
- 404 errors
|
26
|
+
- 500 errors (+ other)
|
24
27
|
|
25
|
-
|
28
|
+
The **`404`** error is standard (missing page) - we use your own `layout` for this. The **`500 & other errors`** are `server` issues, and so we have included an `errors` layout (`/views/layouts/errors.html.haml`).
|
26
29
|
|
27
|
-
|
30
|
+
The `errors` layout in important. If you try and load your "standard" layout with an internal server error, all your
|
31
|
+
"supporting" functionality is called too. Problem? You're likely going to cause even more errors.
|
32
|
+
|
33
|
+
**Custom error pages** are included by default.
|
34
|
+
You can change them by using the **`rails generate exception_handler:assets --views`**:
|
35
|
+
|
36
|
+
**500 Errors** | **404 Errors**
|
37
|
+
--- | ---
|
38
|
+
 | 
|
39
|
+
|
40
|
+
-----------
|
41
|
+
|
42
|
+
####Saving Errors To DB
|
43
|
+
|
44
|
+
Adapted & refactored from [this tutorial](http://www.sharagoz.com/posts/1-rolling-your-own-exception-handler-in-rails-3)
|
45
|
+
|
46
|
+
Sometimes, you want to save your errors to your database (admin areas, multi-tenant apps, etc). We've included some middleware which captures the exceptions & saves them to the db:
|
47
|
+
|
48
|
+
- Model (class) Name
|
49
|
+
- Error Message
|
50
|
+
- Stack trace
|
51
|
+
- Target URL
|
52
|
+
- Referrer URL
|
53
|
+
- Params
|
54
|
+
- User Agent (Browser Details)
|
55
|
+
|
56
|
+
This db allows you to track, read & repair errors in your application on the fly. We deploy this in our admin areas, to help us
|
57
|
+
appreciate any issues on our client apps.
|
58
|
+
|
59
|
+

|
60
|
+
|
61
|
+
This functionality is **`disabled`** by default
|
62
|
+
|
63
|
+
To enable, you need to do the following:
|
64
|
+
|
65
|
+
- rails generate exception_handler:install #-> will install config initializer
|
66
|
+
- rails generate exception_handler:migration #-> will create migration (for `errors` table)
|
67
|
+
- rake db:migrate #-> creates `errors` table
|
68
|
+
|
69
|
+
- config/initializers/exception_handler.rb
|
28
70
|
|
29
71
|
---------
|
30
72
|
|
@@ -42,21 +84,16 @@ Or install it yourself as:
|
|
42
84
|
|
43
85
|
$ gem install exception_handler
|
44
86
|
|
45
|
-
###
|
87
|
+
###Configuration
|
46
88
|
|
47
89
|
# General
|
48
90
|
$ rails generate exception_handler:install
|
49
91
|
|
50
|
-
#
|
51
|
-
$ rails generate exception_handler:
|
92
|
+
# Migration
|
93
|
+
$ rails generate exception_handler:migrate
|
52
94
|
|
53
|
-
#
|
54
|
-
$ rails generate exception_handler:assets
|
55
|
-
-
|
56
|
-
$ rails generate exception_handler:assets:views
|
57
|
-
$ rails generate exception_handler:assets:controllers
|
58
|
-
$ rails generate exception_handler:assets:models
|
59
|
-
$ rails generate exception_handler:assets:assets
|
95
|
+
# Files
|
96
|
+
$ rails generate exception_handler:assets
|
60
97
|
|
61
98
|
|
62
99
|
|
@@ -12,4 +12,4 @@
|
|
12
12
|
/Contact
|
13
13
|
.contact
|
14
14
|
- ExceptionHandler.config.social.each do |item, address|
|
15
|
-
%a{ href: address }> #{image_tag "exception_handler/contact/#{item}.png", title: item.to_s.titleize}
|
15
|
+
%a{ href: address, target: "_blank" }> #{image_tag "exception_handler/contact/#{item}.png", title: item.to_s.titleize}
|
@@ -13,7 +13,7 @@ module ExceptionHandler
|
|
13
13
|
twitter: "http://twitter.com/frontlineutils",
|
14
14
|
facebook: "https://facebook.com/frontline.utilities",
|
15
15
|
linkedin: "https://linkedin.com/company/frontline-utilities",
|
16
|
-
youtube: "
|
16
|
+
youtube: "https://youtube.com/user/frontlineutils",
|
17
17
|
fusion: "http://frontlinefusion.com/frontlineutils"
|
18
18
|
}
|
19
19
|
end
|
@@ -19,7 +19,7 @@ ExceptionHandler.setup do |config|
|
|
19
19
|
twitter: "http://twitter.com/frontlineutils",
|
20
20
|
facebook: "https://facebook.com/frontline.utilities",
|
21
21
|
linkedin: "https://linkedin.com/company/frontline-utilities",
|
22
|
-
youtube: "
|
22
|
+
youtube: "https://youtube.com/user/frontlineutils",
|
23
23
|
fusion: "http://frontlinefusion.com/frontlineutils"
|
24
24
|
}
|
25
25
|
|
data/readme/500.png
ADDED
Binary file
|
data/readme/db.png
ADDED
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: exception_handler
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Richard Peck
|
@@ -124,11 +124,19 @@ files:
|
|
124
124
|
- lib/generators/templates/create_errors.rb
|
125
125
|
- lib/generators/templates/create_table.rb
|
126
126
|
- lib/generators/templates/exception_handler.rb
|
127
|
+
- readme/500.png
|
128
|
+
- readme/db.png
|
127
129
|
- readme/exception_handler.png
|
128
130
|
- spec/exception_spec.rb
|
129
131
|
- spec/installation_spec.rb
|
130
132
|
- spec/spec_helper.rb
|
133
|
+
- vendor/assets/images/exception_handler/alert.png
|
131
134
|
- vendor/assets/images/exception_handler/bg.png
|
135
|
+
- vendor/assets/images/exception_handler/contact/facebook.png
|
136
|
+
- vendor/assets/images/exception_handler/contact/fusion.png
|
137
|
+
- vendor/assets/images/exception_handler/contact/linkedin.png
|
138
|
+
- vendor/assets/images/exception_handler/contact/twitter.png
|
139
|
+
- vendor/assets/images/exception_handler/contact/youtube.png
|
132
140
|
homepage: http://frontlineutilities.co.uk/ror/custom_error_pages
|
133
141
|
licenses:
|
134
142
|
- MIT
|