Added error handling to the framework. github #18