Why is my backtrace being filtered?

I am experiencing an exception in a third party library. For some reason, the backtrace is skipping a lot of lines. I put this in an initializer:

Rails.backtrace_cleaner.remove_silencers!
Rails.backtrace_cleaner.remove_filters!

      

These lines have no effect.

What else can affect the content of the return line? Is there a global object that I can inspect, or a method call that I can find in suspicious gems?

I am using JRuby, Rails 4.1 and the corresponding library is dullard .

further explanation

here is an example of how reverse traces usually work. This code ...

def a
  raise "i am in a"
end

def b
  puts "i am in b"
  a
end

def c
  puts "i am in c"
  b
end

c

      

outputs this result ...

โž” ruby exceptiontest.rb
i am in c
i am in b
exceptiontest.rb:2:in `a': i am in a (RuntimeError)
    from exceptiontest.rb:7:in `b'
    from exceptiontest.rb:12:in `c'
    from exceptiontest.rb:15:in `<main>'

      

with my problem, I am getting this output ...

โž” ruby exceptiontest.rb
i am in c
i am in b
exceptiontest.rb:2:in `a': i am in a (RuntimeError)
    from exceptiontest.rb:15:in `<main>'

      

+3


source to share


1 answer


  • Does this happen in production?
  • Can you provide more context regarding the backlink? By skipping lines, you mean that some of the backtrace is actually visible, but some are not?
  • If you are developing, do you know which stone is raising the exception? If so, open it (the bundle is open) and, using pry

    , place the statement binding.pry

    immediately preceding the line of interest from the backline. You will be able to see what happens during the exception, and if necessary, you will be able cd

    to further context.


0


source







All Articles