@@ -38,6 +38,8 @@ public function __construct(
3838 }
3939
4040 /**
41+ * Validate response schema definition for topic
42+ *
4143 * @param string $responseSchema
4244 * @param string $topicName
4345 * @return void
@@ -46,6 +48,12 @@ public function validateResponseSchemaType($responseSchema, $topicName)
4648 {
4749 try {
4850 $ this ->validateType ($ responseSchema );
51+ } catch (\InvalidArgumentException $ e ) {
52+ throw new \LogicException (
53+ 'Response schema definition has service class with wrong annotated methods ' ,
54+ $ e ->getCode (),
55+ $ e
56+ );
4957 } catch (\Exception $ e ) {
5058 throw new \LogicException (
5159 sprintf (
@@ -59,6 +67,8 @@ public function validateResponseSchemaType($responseSchema, $topicName)
5967 }
6068
6169 /**
70+ * Validate request schema definition for topic
71+ *
6272 * @param string $requestSchema
6373 * @param string $topicName
6474 * @return void
@@ -67,6 +77,12 @@ public function validateRequestSchemaType($requestSchema, $topicName)
6777 {
6878 try {
6979 $ this ->validateType ($ requestSchema );
80+ } catch (\InvalidArgumentException $ e ) {
81+ throw new \LogicException (
82+ 'Request schema definition has service class with wrong annotated methods ' ,
83+ $ e ->getCode (),
84+ $ e
85+ );
7086 } catch (\Exception $ e ) {
7187 throw new \LogicException (
7288 sprintf (
@@ -80,6 +96,8 @@ public function validateRequestSchemaType($requestSchema, $topicName)
8096 }
8197
8298 /**
99+ * Validate service method specified in the definition of handler
100+ *
83101 * @param string $serviceName
84102 * @param string $methodName
85103 * @param string $handlerName
@@ -109,6 +127,7 @@ public function validateResponseHandlersType($serviceName, $methodName, $handler
109127 * @param string $typeName
110128 * @return $this
111129 * @throws \Exception In case when type is invalid
130+ * @throws \InvalidArgumentException if methods don't have annotation
112131 */
113132 protected function validateType ($ typeName )
114133 {
0 commit comments