Better error hanlding

Any exception thrown from templates are catched by the engine and rethrown with a proper error message