Terminate qr script if SQL db connection fails