Handle errors without causes
The method `LoadBalancer#connection_error?` would unwrap errors that inherit from ActiveRecord::StatementInvalid and ActionView::Template::Error, in an attempt to see if any connection errors were wrapped. When given an error without a cause, such as ActiveRecord::RecordNotUnique, it would fail, as `cause` on the error returns `nil`. This in turn would manifest in various tests, such as those for the `ApplicationRecord` model. This commit fixes these issues by just returning `false` when there is no error cause. Changelog: fixed
Showing
Please register or sign in to comment