9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
# File 'lib/griffin/interceptors/server/raven_interceptor.rb', line 9
def request_response(call: nil, **)
if call.metadata['x-request-id']
Raven.tags_context(request_id: call.metadata['x-request-id'])
end
begin
yield
rescue => e
raise e if e.is_a?(GRPC::BadStatus)
GRPC.logger.error("Internal server error: #{e.message}")
Raven.capture_exception(e)
raise GRPC::Unknown.new('Internal server error')
end
ensure
Raven::Context.clear!
Raven::BreadcrumbBuffer.clear!
end
|