testdouble / suture

🏥 A Ruby gem that helps you refactor your legacy code
MIT License
1.41k stars 29 forks source link

Suture.create :on_{new,old,subject}_error handler #42

Closed searls closed 8 years ago

searls commented 8 years ago

Add a custom on-error hook when the new code path fails in production, allowing folks to do something when the code path raises an (unexpected, see: #24 ) error.

on_new_error: -> (name, args, error) { PhonesHome.new.phone(name, args) } 

Its return value doesn't have any kind of impact on what happens next, Suture will propagate the error just as it would have