Terraform google provider resource google_sql_user issue

When I use the google_sql_user resource, if the status of the cloudsql instance is stopped, the error “googleapi: Error 400: Invalid request: Invalid request since instance is not running.” will appear. Is there any way for me to handle this type of exception?

terraform version: 1.5.2

thanks.