Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add RemoveStacktrace processor #233

Merged
merged 1 commit into from
Nov 10, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions lib/raven/processor/removestacktrace.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
module Raven
class Processor::RemoveStacktrace < Processor

def process(value)
value['exception'].delete('stacktrace') if value['exception']

value
end

end
end
19 changes: 19 additions & 0 deletions spec/raven/processors/removestacktrace_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
require 'spec_helper'
require 'raven/processor/removestacktrace'

describe Raven::Processor::RemoveStacktrace do
before do
@client = double("client")
@processor = Raven::Processor::RemoveStacktrace.new(@client)
end

it 'should remove stacktraces' do
data = Raven::Event.capture_exception(build_exception).to_hash

expect(data['exception']['stacktrace']).to_not eq(nil)
result = @processor.process(data)

expect(result['exception']['stacktrace']).to eq(nil)
end

end