Add additional exceptions to PG TLS fallback

flag=none

Change-Id: I8d62233935bdfa330554dcb2f76e2dc126519a54
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/345704
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Andrea Cirulli <andrea.cirulli@instructure.com>
QA-Review: Isaac Moore <isaac.moore@instructure.com>
Product-Review: Isaac Moore <isaac.moore@instructure.com>
This commit is contained in:
Isaac Moore 2024-04-19 13:53:52 -05:00
parent 4ab0aaca4a
commit 9cb5ef8fac
1 changed files with 2 additions and 2 deletions

View File

@ -185,7 +185,7 @@ module CanvasRails
begin
return super(conn_params)
rescue ::ActiveRecord::ActiveRecordError => e
rescue ::ActiveRecord::ActiveRecordError, ::PG::Error => e
# If exception occurs using parameters from a predefined pg service, retry without
if conn_params.key?(:service)
CanvasErrors.capture(e, { tags: { pg_service: conn_params[:service] } }, :warn)
@ -236,7 +236,7 @@ module CanvasRails
else
@raw_connection = PG::Connection.connect(connection_parameters)
end
rescue ::PG::Error => e
rescue ::ActiveRecord::ActiveRecordError, ::PG::Error => e
# If exception occurs using parameters from a predefined pg service, retry without
if connection_parameters.key?(:service)
CanvasErrors.capture(e, { tags: { pg_service: connection_parameters[:service] } }, :warn)