added raise_exception, compiles, tested by hand
added models for integration test
added tests for functions which throw exceptions