How to get an array of Thread::Backtrace::Location related to an exception

StackOverflow https://stackoverflow.com/questions/18177913

  •  24-06-2022
  •  | 
  •  

Вопрос

Is there a way to get an array of Thread::Backtrace::Location instances attached to an Exception instance? If so, how? There are Kernel#caller_locations and Thread#backtrace_locations, but those are related to the current context or a thread, and not to an arbitrary exception instance. I don't know if those are to be used.

Это было полезно?

Решение

Yes, it's possible since ruby v2.1, although full support will probably be ready in v2.2

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top