Skip to content
Snippets Groups Projects
Commit 87e0c1ad authored by Johannes Hörmann's avatar Johannes Hörmann
Browse files

better error message

parent aece9d36
No related branches found
No related tags found
No related merge requests found
......@@ -390,12 +390,28 @@ SqlCondition.prototype._prepare = function(field, value, cond, fieldType) {
if (typeof field === 'string')
{
alias = field;
var pointPos = field.indexOf(".");
if (pointPos > 0 && pointPos < field.length-1)
{
alias = field;
}
else
{
throw new Error(translate.withArguments("${SQL_LIB_FIELD_WRONG_FORMAT} field: %0", [field]));
}
}
else
{
alias = field[2] + "." + field[1];
field = field[0] + "." + field[1];
if (field.length == 3)
{
alias = field[2] + "." + field[1];
field = field[0] + "." + field[1];
}
else
{
throw new Error(translate.withArguments("${SQL_LIB_FIELD_WRONG_FORMAT} field: %0", [field.toSource()]));
}
}
var type;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment