> @@ -64,6 +51,36 @@ def local_host
> "127.0.0.1"
> end
>
> + # Error rescued by middleware.
> + #
> + # @return [Exception or NilClass]
> + def error
> + @middleware.error
> + end
> +
> + # Check if exception catcher is enabled.
> + #
> + # @return [Boolean] true if exception catcher is and can be enabled,
> false otherwise.
> + def catch_exceptions
> + @catch_exceptions = true if @catch_exceptions.nil?
This line seems `fishy`.
I'd remove it and use something like this instead:
````ruby
unless @catch_exceptions == false
# ...
end
````
On another note - maybe the name `catch_exceptions` itself is wrong, because we
are raising exceptions and not catching them - that is the thing, which
`Watir::Rails` will do if it is set to true.
In other words, i would turn it around, because we want to raise exceptions by
default. So something like this:
````ruby
attr_writer :ignore_rails_exceptions
def ignore_rails_exceptions
unless @ignore_rails_exceptions # this works with nil and false, which is
what we want by default
# ...
if show_exceptions
warn "..."
@ignore_rails_exceptions = true
end
end
@ignore_rails_exceptions
end
````
Thoughts?
---
Reply to this email directly or view it on GitHub:
https://github.com/watir/watir-rails/pull/2/files#r4342626
_______________________________________________
Wtr-development mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-development