This commit is contained in:
jdl 2024-11-19 08:57:49 +01:00
parent 587cd1c9b4
commit 5577f90f95

View File

@ -18,10 +18,10 @@ func translateError(err error) error {
return nil
}
if e, ok := err.(sqlite3.Error); ok && e.Code == 19 {
return ErrConstraint
return errors.Join(ErrConstraint, err)
}
if errors.Is(err, sql.ErrNoRows) {
return ErrNotFound
return errors.Join(ErrNotFound, err)
}
return err
}