diff --git a/.changelog/16059.txt b/.changelog/16059.txt new file mode 100644 index 00000000000..cc17ea9c3e7 --- /dev/null +++ b/.changelog/16059.txt @@ -0,0 +1,3 @@ +```release-note:bug +sql: fixed an issue where transient server errors caused false failures for SQL operations that eventually completed successfully +``` \ No newline at end of file diff --git a/google/services/sql/sqladmin_operation.go b/google/services/sql/sqladmin_operation.go index a4186c5b558..14e6c9b08ed 100644 --- a/google/services/sql/sqladmin_operation.go +++ b/google/services/sql/sqladmin_operation.go @@ -47,7 +47,7 @@ func (w *SqlAdminOperationWaiter) State() string { } func (w *SqlAdminOperationWaiter) Error() error { - if w != nil && w.Op != nil && w.Op.Error != nil { + if w != nil && w.Op != nil && w.Op.Error != nil && w.Op.Status == "DONE" { return SqlAdminOperationError(*w.Op.Error) } return nil