Skip to content

Commit

Permalink
Merge pull request supabase#237 from dymium-io/supabase#218
Browse files Browse the repository at this point in the history
[supabase#218] Fixes 218, adds human readable explanation
  • Loading branch information
gazillion101 authored Apr 8, 2023
2 parents e7872bb + bc5d6f9 commit 0e008da
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions web/go/src/authentication/authentication.go
Original file line number Diff line number Diff line change
Expand Up @@ -1806,6 +1806,9 @@ func DeleteConnection(schema, id string) error {
if err != nil {
tx.Rollback()
log.Errorf("DeleteConnection error 5: %s", err.Error())
if(strings.Contains(err.Error(), "foreign key ")) {
err = errors.New( fmt.Sprintf("%s. Most likely the Data Source is used in a Ghost Database. It has to be cleaned up first.", err.Error()) )
}
return err
}

Expand Down Expand Up @@ -2443,6 +2446,9 @@ func DeleteConnector(schema, Id string) error {
if err != nil {
tx.Rollback()
log.Errorf("DeleteConnector error 0: %s", err.Error())
if(strings.Contains(err.Error(), "foreign key ")) {
err = errors.New( fmt.Sprintf("%s. Most likely the connector is used in a Data Source. It has to be cleaned up first.", err.Error()) )
}
return err
}

Expand Down

0 comments on commit 0e008da

Please sign in to comment.