Throw meaningful error when form.get is called with errors

Rework of #3497.