yeller_ruby 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/yeller/client.rb +8 -5
- data/lib/yeller/configuration.rb +32 -0
- data/lib/yeller/skip_exceptions.rb +14 -0
- data/lib/yeller/version.rb +1 -1
- data/lib/yeller.rb +3 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 62c1fef8f69ab232a2448bbaa4b13d1b222203f0
|
4
|
+
data.tar.gz: f5db5b74752b847b96001c1f6ef28e1d06c17547
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5ba53bdecbb37074b01b91f55b96b10d77408f5e614879009a051ca659d3acf238b4232f45648d2866710010002906f8952dfc5ce2ed1c714689678704c10b72
|
7
|
+
data.tar.gz: 0184cdcb3d444ab50c9e5fdcad0329f29d2a6f14fa0db371374351866127a93b01a5ff16e1ff87308c4565a6288c464e8b15b04f61001bf5a83f2d2365bbce6d
|
data/lib/yeller/client.rb
CHANGED
@@ -2,20 +2,23 @@ module Yeller
|
|
2
2
|
class Client
|
3
3
|
attr_reader :backtrace_filter, :token
|
4
4
|
|
5
|
-
def initialize(servers, token, startup_params, backtrace_filter, error_handler)
|
5
|
+
def initialize(servers, token, startup_params, backtrace_filter, error_handler, skip_exceptions)
|
6
6
|
@servers = servers
|
7
7
|
@last_server = rand(servers.size)
|
8
8
|
@startup_params = startup_params
|
9
9
|
@token = token
|
10
|
-
@error_handler = error_handler
|
11
10
|
@backtrace_filter = backtrace_filter
|
11
|
+
@error_handler = error_handler
|
12
|
+
@skip_exceptions = skip_exceptions
|
12
13
|
@reported_error = false
|
13
14
|
end
|
14
15
|
|
15
16
|
def report(exception, options={})
|
16
|
-
|
17
|
-
|
18
|
-
|
17
|
+
unless @skip_exceptions.skip?(exception)
|
18
|
+
hash = ExceptionFormatter.format(exception, backtrace_filter, options)
|
19
|
+
serialized = JSON.dump(@startup_params.merge(hash))
|
20
|
+
report_with_roundtrip(serialized, 0)
|
21
|
+
end
|
19
22
|
end
|
20
23
|
|
21
24
|
def report_with_roundtrip(serialized, error_count)
|
data/lib/yeller/configuration.rb
CHANGED
@@ -11,11 +11,23 @@ module Yeller
|
|
11
11
|
Yeller::SecureServer.new("collector5.yellerapp.com", 443),
|
12
12
|
]
|
13
13
|
|
14
|
+
DEFAULT_SKIPPED_EXCEPTIONS = [
|
15
|
+
'AbstractController::ActionNotFound',
|
16
|
+
'ActionController::InvalidAuthenticityToken',
|
17
|
+
'ActionController::RoutingError',
|
18
|
+
'ActionController::UnknownAction',
|
19
|
+
'ActiveRecord::RecordNotFound',
|
20
|
+
'CGI::Session::CookieStore::TamperedWithCookie',
|
21
|
+
'Mongoid::Errors::DocumentNotFound',
|
22
|
+
'Sinatra::NotFound'
|
23
|
+
]
|
24
|
+
|
14
25
|
def initialize
|
15
26
|
@servers = DEFAULT_SERVERS
|
16
27
|
@startup_params = {}
|
17
28
|
@error_handler = Yeller::LogErrorHandler.new
|
18
29
|
@development_environments = Set.new(['development', 'test'])
|
30
|
+
@skip_exceptions = DEFAULT_SKIPPED_EXCEPTIONS
|
19
31
|
end
|
20
32
|
|
21
33
|
def remove_default_servers
|
@@ -100,5 +112,25 @@ module Yeller
|
|
100
112
|
def project_root=(new_project_root)
|
101
113
|
@project_root = new_project_root
|
102
114
|
end
|
115
|
+
|
116
|
+
def skip_exceptions
|
117
|
+
Yeller::SkipExceptions.new(
|
118
|
+
@skip_exceptions || [],
|
119
|
+
@skip_exceptions_callback || Proc.new {|e| false}
|
120
|
+
)
|
121
|
+
end
|
122
|
+
|
123
|
+
def skip_exceptions=(skip_exceptions)
|
124
|
+
@skip_exceptions = skip_exceptions
|
125
|
+
end
|
126
|
+
|
127
|
+
def add_skip_exceptions(skip_exceptions)
|
128
|
+
@skip_exceptions ||= []
|
129
|
+
@skip_exceptions = @skip_exceptions + skip_exceptions
|
130
|
+
end
|
131
|
+
|
132
|
+
def skip_exceptions_callback(skip_exceptions_callback)
|
133
|
+
@skip_exceptions_callback = skip_exceptions_callback
|
134
|
+
end
|
103
135
|
end
|
104
136
|
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
require 'set'
|
2
|
+
module Yeller
|
3
|
+
class SkipExceptions
|
4
|
+
def initialize(error_names, callback)
|
5
|
+
@error_names = Set.new(error_names)
|
6
|
+
@callback = callback
|
7
|
+
end
|
8
|
+
|
9
|
+
def skip?(exception)
|
10
|
+
@error_names.include?(exception.class.name) ||
|
11
|
+
@callback.call(exception)
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
data/lib/yeller/version.rb
CHANGED
data/lib/yeller.rb
CHANGED
@@ -7,6 +7,7 @@ require File.expand_path('../yeller/ignoring_client', __FILE__)
|
|
7
7
|
require File.expand_path('../yeller/configuration', __FILE__)
|
8
8
|
require File.expand_path('../yeller/exception_formatter', __FILE__)
|
9
9
|
require File.expand_path('../yeller/server', __FILE__)
|
10
|
+
require File.expand_path('../yeller/skip_exceptions', __FILE__)
|
10
11
|
require File.expand_path('../yeller/version', __FILE__)
|
11
12
|
require File.expand_path('../yeller/startup_params', __FILE__)
|
12
13
|
require File.expand_path('../yeller/log_error_handler', __FILE__)
|
@@ -33,7 +34,8 @@ module Yeller
|
|
33
34
|
config.token,
|
34
35
|
Yeller::StartupParams.defaults(config.startup_params),
|
35
36
|
Yeller::BacktraceFilter.new(config.backtrace_filename_filters, config.backtrace_method_filters),
|
36
|
-
config.error_handler
|
37
|
+
config.error_handler,
|
38
|
+
config.skip_exceptions
|
37
39
|
)
|
38
40
|
end
|
39
41
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: yeller_ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tom Crayford
|
@@ -70,6 +70,7 @@ files:
|
|
70
70
|
- lib/yeller/rails.rb
|
71
71
|
- lib/yeller/rails/tasks.rb
|
72
72
|
- lib/yeller/server.rb
|
73
|
+
- lib/yeller/skip_exceptions.rb
|
73
74
|
- lib/yeller/startup_params.rb
|
74
75
|
- lib/yeller/verify_log.rb
|
75
76
|
- lib/yeller/version.rb
|