Exception handling in function templates

Add errors as part of function template annotation