Module: Trackets
- Defined in:
- lib/trackets/middleware/rack_exception_handler.rb,
lib/trackets.rb,
lib/trackets/client.rb,
lib/trackets/params.rb,
lib/trackets/railtie.rb,
lib/trackets/version.rb,
lib/trackets/null_env.rb,
lib/trackets/backtrace.rb,
lib/trackets/view_helpers.rb,
lib/trackets/configuration.rb,
lib/trackets/rack_env_sanitizer.rb,
lib/generators/trackets/install_generator.rb
Overview
Middleware for Rack applications
Example of a basic Rack app
require 'rack'
require 'trackets'
Trackets.setup do |config|
config.api_key = "insert-valid-api-key"
end
app = Rack::Builder.app do
run lambda { |env| raise "Testing Error" }
end
use Trackets::Middleware::RackExceptionHandler
run app
Defined Under Namespace
Modules: Generators, Middleware, ViewHelpers
Classes: Backtrace, Client, Configuration, NullEnv, Params, RackEnvSanitizer, Railtie, TracketsCustomException
Constant Summary
collapse
- VERSION =
"0.0.4"
Class Method Summary
collapse
Class Method Details
.configuration ⇒ Object
14
15
16
|
# File 'lib/trackets.rb', line 14
def configuration
@configuration ||= Configuration.new
end
|
.notify(exception, env = nil) ⇒ Object
18
19
20
|
# File 'lib/trackets.rb', line 18
def notify(exception, env = nil)
Client.notify(exception, env)
end
|
.send_custom_exception(message = nil) ⇒ Object
24
25
26
27
28
29
30
|
# File 'lib/trackets.rb', line 24
def send_custom_exception(message = nil)
begin
raise TracketsCustomException, message
rescue TracketsCustomException => e
Trackets.notify(e)
end
end
|
.setup {|configuration| ... } ⇒ Object
10
11
12
|
# File 'lib/trackets.rb', line 10
def setup
yield(configuration)
end
|