Log error when building form queries