chore(tasks): add more details to error message

Trying to debug https://vikunja.sentry.io/share/issue/ef81451b0c7b43f1bff2d3a86ba393bb/
This commit is contained in:
kolaente 2024-09-29 21:44:28 +02:00
parent 3855e179a9
commit d22bc79d3c
No known key found for this signature in database
GPG Key ID: F40E70337AB24C9B
1 changed files with 2 additions and 1 deletions

View File

@ -301,7 +301,8 @@ func (d *dbTaskSearcher) Search(opts *taskSearchOptions) (tasks []*Task, totalCo
OrderBy(orderby).
Find(&tasks)
if err != nil {
return nil, totalCount, fmt.Errorf("could not fetch tasks: %w", err)
sql, vals := query.LastSQL()
return nil, 0, fmt.Errorf("could not fetch task count, error was '%w', sql: '%v', vaues: %v", err, sql, vals)
}
// fetch subtasks when expanding