Right now we do not handle error union as return type for functions, so we do not handle error cases! We should add this and, when an error is returned, throw it as an Exception to the JS engine.