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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9910d9ea8a74498ce664a912a9615bed8e8c9ce1
4
- data.tar.gz: 20e2b4badb0d3bab269375565f0b8e7141c9bca6
3
+ metadata.gz: dcd9b5923dc39f43b43beb02ee3004ea850f3103
4
+ data.tar.gz: f9c1174fe636735617607af47e51cf5b43eb178b
5
5
  SHA512:
6
- metadata.gz: a2be4863eb8b102b2ecd78bd9d8895d08f2b276b31b7ecc9e497c76a7f1594efe1a5ddda192851b7a47173fca23137a3a786b0d376dcceed050d65693fdac6f0
7
- data.tar.gz: f75a584b9264900b20d8af0f495318ca9a17db5c6b773526396838bad23898f4a4ec7de8902f22f3cd25c6dc874428040021d93433af6061ebbd542458b8f2ab
6
+ metadata.gz: b85c858abce97e7937823922a0981caae1b3dbdd0ae639a52431b4a3f139a7ee2661adf38307846829b4a6d7d293be26ada2546d15711f6632892d77f7fff69a
7
+ data.tar.gz: a3705b63eb93501674d6dd829c98bee369ef70911377177c742c7293d81e737cd4e409d4d22554076b79241eeaeafbcc74b2505b49acdc264504d4fd13d60c93
data/README.md CHANGED
@@ -7,7 +7,7 @@
7
7
  [![Build Status](https://travis-ci.org/richpeck/exception_handler.svg?branch=master)](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) & our own middleware)
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 create *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
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
- ####Save Errors To DB
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
- Sometimes, you want to save your errors to your database (admin areas, multi-tenant apps, etc). We've included some middleware which captures the routes
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
+ ![500 Server Error Pages](https://raw.githubusercontent.com/richpeck/exception_handler/master/readme/500.png "500 Server Error Page") | ![404 Server Error Pages](https://raw.githubusercontent.com/richpeck/exception_handler/master/readme/500.png "404 Server Error Page")
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
+ ![500 Server Error Pages](https://raw.githubusercontent.com/richpeck/exception_handler/master/readme/db.png "500 Server Error Page")
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
- ###Generators
87
+ ###Configuration
46
88
 
47
89
  # General
48
90
  $ rails generate exception_handler:install
49
91
 
50
- #Config (for db)
51
- $ rails generate exception_handler:config
92
+ # Migration
93
+ $ rails generate exception_handler:migrate
52
94
 
53
- #Assets
54
- $ rails generate exception_handler:assets:all
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}
@@ -19,8 +19,8 @@
19
19
  .error_container
20
20
  display: block
21
21
  margin: auto
22
- margin: 15% auto 0 auto
23
- width: 40%
22
+ margin: 10% auto 0 auto
23
+ width: 30%
24
24
 
25
25
  .error_container .error
26
26
  display: block
@@ -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: "http://youtube.com/frontlineutils",
16
+ youtube: "https://youtube.com/user/frontlineutils",
17
17
  fusion: "http://frontlinefusion.com/frontlineutils"
18
18
  }
19
19
  end
@@ -1,3 +1,3 @@
1
1
  module ExceptionHandler
2
- VERSION = "0.2.6"
2
+ VERSION = "0.2.7"
3
3
  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: "http://youtube.com/frontlineutils",
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
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.6
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