Added exception handling to malformed query from attribute 'from query' in connection section