Helper handles error in creation of TransportFactory
In case the EtchTransportFactory cannot return a ServerFactory for the
given URI, e.g. in case the user forgets to add the tcp:// prefix in the
connection URI, now an error is returned.
Change-Id: I636d2e6a507210fa371b73dd380a0e6ed15cef3b
git-svn-id: https://svn.apache.org/repos/asf/etch/trunk@1584587 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/binding-cpp/compiler/src/main/resources/org/apache/etch/bindings/cpp/compiler/helper_cpp.vm b/binding-cpp/compiler/src/main/resources/org/apache/etch/bindings/cpp/compiler/helper_cpp.vm
index 5d408e0..ffb3af0 100644
--- a/binding-cpp/compiler/src/main/resources/org/apache/etch/bindings/cpp/compiler/helper_cpp.vm
+++ b/binding-cpp/compiler/src/main/resources/org/apache/etch/bindings/cpp/compiler/helper_cpp.vm
@@ -133,7 +133,11 @@
//get listener
EtchTransport<EtchServerFactory>* listener;
- EtchTransportFactory::getListener(runtime, uri, res, listener);
+ status = EtchTransportFactory::getListener(runtime, uri, res, listener);
+ if (status != ETCH_OK) {
+ ETCH_LOG_ERROR(runtime->getLogger(), runtime->getLogger().getRuntimeContext(), "Listener could not be created by the transport factory for the given URI.");
+ return status;
+ }
//create server
serverFactory = new $clname::Listener${i}Server(listener, implFactory);