You need to sign in to do that
Don't have an account?
mshelman
No error handling on dynamic soql?
This code
try {
return Database.query(soql);
}
catch (QueryException e) {
this.errorString = 'There is a problem with your search parameters. Please check your search and try again.';
return null;
}
does not enter the catch block when a select query with a filter (criteria) of the wrong tyoe is attempted. It simply loads up the error page with: System.QueryException :unexpected token: ss. In other words it acts exactly the same as if there were no try/catch
try {
return Database.query(soql);
}
catch (QueryException e) {
this.errorString = 'There is a problem with your search parameters. Please check your search and try again.';
return null;
}
does not enter the catch block when a select query with a filter (criteria) of the wrong tyoe is attempted. It simply loads up the error page with: System.QueryException :unexpected token: ss. In other words it acts exactly the same as if there were no try/catch