mirror of
https://github.com/semaphoreui/semaphore.git
synced 2024-11-23 12:30:41 +01:00
fix(be): correct error message for foreign key errors
This commit is contained in:
parent
858f135fd0
commit
a9c04117c5
@ -51,6 +51,9 @@ var (
|
||||
// validateMutationResult checks the success of the update query
|
||||
func validateMutationResult(res sql.Result, err error) error {
|
||||
if err != nil {
|
||||
if strings.Contains(err.Error(), "foreign key") {
|
||||
err = db.ErrInvalidOperation
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user