1
0
mirror of https://github.com/astaxie/beego.git synced 2024-12-23 03:30:49 +00:00

Return error when wrong filtering field

When end user put wrong filtering field ORM should return error instead of Panic()
so developers can handle this error.
This commit is contained in:
Atallah khedrane 2018-09-23 12:18:15 +02:00 committed by GitHub
parent 053a075344
commit 0e4d954fa7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -928,7 +928,7 @@ func (d *dbBase) ReadBatch(q dbQuerier, qs *querySet, mi *modelInfo, cond *Condi
maps[fi.column] = true
}
} else {
panic(fmt.Errorf("wrong field/column name `%s`", col))
return -1, fmt.Errorf("wrong field/column name `%s`", col)
}
}
if hasRel {