Commit fed75299 authored by Rémy Coutable's avatar Rémy Coutable

Merge branch 'deprecated-original-exception' into 'master'

Fix deprecation: #original_exception is deprecated. Use #cause instead.

See merge request gitlab-org/gitlab-ee!9141
parents 0cba7657 a6c3df47
---
title: 'Fix deprecation: #original_exception is deprecated. Use #cause instead.'
merge_request: 9141
author: Jasper Maes
type: other
...@@ -138,7 +138,7 @@ module Gitlab ...@@ -138,7 +138,7 @@ module Gitlab
when ActiveRecord::StatementInvalid, ActionView::Template::Error when ActiveRecord::StatementInvalid, ActionView::Template::Error
# After connecting to the DB Rails will wrap query errors using this # After connecting to the DB Rails will wrap query errors using this
# class. # class.
connection_error?(error.original_exception) connection_error?(error.cause)
when *CONNECTION_ERRORS when *CONNECTION_ERRORS
true true
else else
...@@ -151,8 +151,8 @@ module Gitlab ...@@ -151,8 +151,8 @@ module Gitlab
end end
def serialization_failure?(error) def serialization_failure?(error)
if error.respond_to?(:original_exception) if error.cause
serialization_failure?(error.original_exception) serialization_failure?(error.cause)
else else
error.is_a?(PG::TRSerializationFailure) error.is_a?(PG::TRSerializationFailure)
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment