Added support to throwing errors outside the validate block with custom code

Signed-off-by: Malte Sussdorff <malte.sussdorff@cognovis.com>