[#941860] Introduce handling possible exceptions from connect_db