When exception capturing is enabled, the actual location of a failure is hidden. This makes error handling and debugging very cumbersome, especially in complex codebases. Consider this example where the same error is shown despite failures happening in different places.
class TestService < Servitium::Service
capture_exceptions true
def perform
random_method = %w[a b c].sample
puts "sending random method #{random_method}"
send(random_method)
end
def a
not_implemented
end
def b
not_implemented
end
def c
not_implemented
end
end
> TestService.perform
sending random method c
#<Servitium::Context> (success: false, valid: false, errors: undefined local variable or method 'not_implemented' for an instance of TestService)
> TestService.perform
sending random method a
#<Servitium::Context> (success: false, valid: false, errors: undefined local variable or method 'not_implemented' for an instance of TestService)
> TestService.perform
sending random method b
#<Servitium::Context> (success: false, valid: false, errors: undefined local variable or method 'not_implemented' for an instance of TestService)
When exception capturing is enabled, the actual location of a failure is hidden. This makes error handling and debugging very cumbersome, especially in complex codebases. Consider this example where the same error is shown despite failures happening in different places.