Add raise_on_error function
Use raise_on_error in connect function