Skip to content

Commit d7f62a3

Browse files
committed
exceptions log
1 parent 78c2d34 commit d7f62a3

File tree

4 files changed

+48
-5
lines changed

4 files changed

+48
-5
lines changed

Gemfile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ gem 'rolify'
1818
gem 'simple_form'
1919
gem 'inherited_resources'
2020

21+
# exceptions catch
22+
gem 'party_foul'
23+
2124
# Use SCSS for stylesheets
2225
gem 'sass-rails', '~> 4.0.0'
2326

@@ -42,7 +45,7 @@ gem 'jquery-ui-rails'
4245
gem 'zurb-foundation'
4346

4447
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
45-
gem 'jbuilder', '~> 1.2'
48+
#gem 'jbuilder', '~> 1.2'
4649

4750
group :doc do
4851
# bundle exec rake doc:rails generates the API under doc/api.

Gemfile.lock

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ GEM
4848
multi_json (~> 1.3)
4949
thread_safe (~> 0.1)
5050
tzinfo (~> 0.3.37)
51+
addressable (2.3.5)
5152
arel (4.0.0)
5253
atomic (1.1.12)
5354
aws-sdk (1.11.1)
@@ -84,6 +85,8 @@ GEM
8485
eventmachine (1.0.3)
8586
execjs (1.4.0)
8687
multi_json (~> 1.0)
88+
faraday (0.8.8)
89+
multipart-post (~> 1.2.0)
8790
font-awesome-rails (3.2.1.2)
8891
railties (>= 3.2, < 5.0)
8992
haml (4.0.3)
@@ -101,9 +104,6 @@ GEM
101104
inherited_resources (1.4.1)
102105
has_scope (~> 0.6.0.rc)
103106
responders (~> 1.0.0.rc)
104-
jbuilder (1.5.0)
105-
activesupport (>= 3.0.0)
106-
multi_json (>= 1.2.0)
107107
jquery-rails (3.0.4)
108108
railties (>= 3.0, < 5.0)
109109
thor (>= 0.14, < 2.0)
@@ -122,10 +122,15 @@ GEM
122122
mini_portile (0.5.1)
123123
minitest (4.7.5)
124124
multi_json (1.7.8)
125+
multipart-post (1.2.0)
125126
nested_form (0.3.2)
126127
nokogiri (1.6.0)
127128
mini_portile (~> 0.5.0)
129+
octokit (2.3.1)
130+
sawyer (~> 0.5.1)
128131
orm_adapter (0.4.0)
132+
party_foul (1.4.0)
133+
octokit (~> 2.3.1)
129134
pg (0.17.0)
130135
polyglot (0.3.3)
131136
quiet_assets (1.0.2)
@@ -184,6 +189,9 @@ GEM
184189
railties (>= 4.0.0.beta, < 5.0)
185190
sass (>= 3.1.10)
186191
sprockets-rails (~> 2.0.0)
192+
sawyer (0.5.1)
193+
addressable (~> 2.3.5)
194+
faraday (~> 0.8, < 0.10)
187195
sdoc (0.3.20)
188196
json (>= 1.1.3)
189197
rdoc (~> 3.10)
@@ -234,9 +242,9 @@ DEPENDENCIES
234242
devise!
235243
haml-rails
236244
inherited_resources
237-
jbuilder (~> 1.2)
238245
jquery-rails
239246
jquery-ui-rails
247+
party_foul
240248
pg
241249
quiet_assets
242250
rails (= 4.0.0)

config/environments/production.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,4 +77,6 @@
7777

7878
# Use default logging formatter so that PID and timestamp are not suppressed.
7979
config.log_formatter = ::Logger::Formatter.new
80+
81+
config.middleware.use('PartyFoul::Middleware')
8082
end

config/initializers/party_foul.rb

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
PartyFoul.configure do |config|
2+
# The collection of exceptions PartyFoul should not be allowed to handle
3+
# The constants here *must* be represented as strings
4+
config.blacklisted_exceptions = ['ActiveRecord::RecordNotFound', 'ActionController::RoutingError']
5+
6+
# The OAuth token for the account that is opening the issues on Github
7+
config.oauth_token = '9455046eab664a8af90c19b1a9d5ce9c5a09b1c3'
8+
9+
# The Web URL for Github. Unless you are hosting a private
10+
# instance of Enterprise Github you do not need to include this
11+
config.web_url = 'https://github.com'
12+
13+
# The organization or user that owns the target repository
14+
config.owner = 'ktm5411'
15+
16+
# The repository for this application
17+
config.repo = 'prooflet'
18+
19+
# The branch for your deployed code
20+
# config.branch = 'master'
21+
22+
# Additional labels to add to issues created
23+
# config.additional_labels = ['production']
24+
config.additional_labels = Proc.new do |exception, env|
25+
labels = []
26+
labels << (env["RACK_ENV"] || env["RAILS_ENV"]) if env["RACK_ENV"] || env["RAILS_ENV"]
27+
labels << 'database' if exception.message =~ /PG::Error/
28+
labels
29+
end
30+
end

0 commit comments

Comments
 (0)