You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In general I'm very happy with Contracts and I don't want to miss it anymore. Nevertheless, there's one annoying problem. With Contracts in use backtraces (stacktraces) become quite messed up.
I know I can use the NO_CONTRACTS environment variable. But that's not always a practical solution, because I need to restart the application and reproduce whatever took me to the backtrace.
Example 1: Backtrace from Contract violation
/usr/lib64/ruby/gems/2.1.0/gems/contracts-0.16.0/lib/contracts.rb:49:in `block in <class:Contract>'
/usr/lib64/ruby/gems/2.1.0/gems/contracts-0.16.0/lib/contracts.rb:155:in `call'
/usr/lib64/ruby/gems/2.1.0/gems/contracts-0.16.0/lib/contracts.rb:155:in `failure_callback'
/usr/lib64/ruby/gems/2.1.0/gems/contracts-0.16.0/lib/contracts/method_handler.rb:143:in `rescue in block in redefine_method'
/usr/lib64/ruby/gems/2.1.0/gems/contracts-0.16.0/lib/contracts/method_handler.rb:136:in `block in redefine_method'
/home/user/mycode/app.rb:42:in `some_method_b'
[...]
Example 2: An exception in a method guided by a Contract
Could you please look for a way to clean the backtrace from all lines with internal Contracts code?
E.g.: /usr/lib64/ruby/gems/2.1.0/gems/contracts-0.16.0/lib/contracts/method_handler.rb:138:in *`block in redefine_method'
If that's possible, an global option to enable/disable that backtrace cleaning would be wonderful.
The text was updated successfully, but these errors were encountered:
In general I'm very happy with Contracts and I don't want to miss it anymore. Nevertheless, there's one annoying problem. With Contracts in use backtraces (stacktraces) become quite messed up.
I know I can use the NO_CONTRACTS environment variable. But that's not always a practical solution, because I need to restart the application and reproduce whatever took me to the backtrace.
Example 1: Backtrace from Contract violation
Example 2: An exception in a method guided by a Contract
Could you please look for a way to clean the backtrace from all lines with internal Contracts code?
E.g.:
/usr/lib64/ruby/gems/2.1.0/gems/contracts-0.16.0/lib/contracts/method_handler.rb:138:in *`block in redefine_method'
If that's possible, an global option to enable/disable that backtrace cleaning would be wonderful.
The text was updated successfully, but these errors were encountered: