@@ -75,7 +75,13 @@ public void listFunctions(
7575 } else if (response instanceof Exception ) {
7676 responseObserver .onError (((Exception ) response ));
7777 } else {
78- responseObserver .onError (new IllegalArgumentException ("Unrecognized response type" ));
78+ responseObserver .onError (
79+ new IllegalArgumentException (
80+ String .format (
81+ "Unrecognized response type %s for method ListFunctions, expected %s or %s" ,
82+ response .getClass ().getName (),
83+ ListFunctionsResponse .class .getName (),
84+ Exception .class .getName ())));
7985 }
8086 }
8187
@@ -90,7 +96,13 @@ public void getFunction(
9096 } else if (response instanceof Exception ) {
9197 responseObserver .onError (((Exception ) response ));
9298 } else {
93- responseObserver .onError (new IllegalArgumentException ("Unrecognized response type" ));
99+ responseObserver .onError (
100+ new IllegalArgumentException (
101+ String .format (
102+ "Unrecognized response type %s for method GetFunction, expected %s or %s" ,
103+ response .getClass ().getName (),
104+ CloudFunction .class .getName (),
105+ Exception .class .getName ())));
94106 }
95107 }
96108
@@ -105,7 +117,13 @@ public void createFunction(
105117 } else if (response instanceof Exception ) {
106118 responseObserver .onError (((Exception ) response ));
107119 } else {
108- responseObserver .onError (new IllegalArgumentException ("Unrecognized response type" ));
120+ responseObserver .onError (
121+ new IllegalArgumentException (
122+ String .format (
123+ "Unrecognized response type %s for method CreateFunction, expected %s or %s" ,
124+ response .getClass ().getName (),
125+ Operation .class .getName (),
126+ Exception .class .getName ())));
109127 }
110128 }
111129
@@ -120,7 +138,13 @@ public void updateFunction(
120138 } else if (response instanceof Exception ) {
121139 responseObserver .onError (((Exception ) response ));
122140 } else {
123- responseObserver .onError (new IllegalArgumentException ("Unrecognized response type" ));
141+ responseObserver .onError (
142+ new IllegalArgumentException (
143+ String .format (
144+ "Unrecognized response type %s for method UpdateFunction, expected %s or %s" ,
145+ response .getClass ().getName (),
146+ Operation .class .getName (),
147+ Exception .class .getName ())));
124148 }
125149 }
126150
@@ -135,7 +159,13 @@ public void deleteFunction(
135159 } else if (response instanceof Exception ) {
136160 responseObserver .onError (((Exception ) response ));
137161 } else {
138- responseObserver .onError (new IllegalArgumentException ("Unrecognized response type" ));
162+ responseObserver .onError (
163+ new IllegalArgumentException (
164+ String .format (
165+ "Unrecognized response type %s for method DeleteFunction, expected %s or %s" ,
166+ response .getClass ().getName (),
167+ Operation .class .getName (),
168+ Exception .class .getName ())));
139169 }
140170 }
141171
@@ -150,7 +180,13 @@ public void callFunction(
150180 } else if (response instanceof Exception ) {
151181 responseObserver .onError (((Exception ) response ));
152182 } else {
153- responseObserver .onError (new IllegalArgumentException ("Unrecognized response type" ));
183+ responseObserver .onError (
184+ new IllegalArgumentException (
185+ String .format (
186+ "Unrecognized response type %s for method CallFunction, expected %s or %s" ,
187+ response .getClass ().getName (),
188+ CallFunctionResponse .class .getName (),
189+ Exception .class .getName ())));
154190 }
155191 }
156192
@@ -166,7 +202,13 @@ public void generateUploadUrl(
166202 } else if (response instanceof Exception ) {
167203 responseObserver .onError (((Exception ) response ));
168204 } else {
169- responseObserver .onError (new IllegalArgumentException ("Unrecognized response type" ));
205+ responseObserver .onError (
206+ new IllegalArgumentException (
207+ String .format (
208+ "Unrecognized response type %s for method GenerateUploadUrl, expected %s or %s" ,
209+ response .getClass ().getName (),
210+ GenerateUploadUrlResponse .class .getName (),
211+ Exception .class .getName ())));
170212 }
171213 }
172214
@@ -182,7 +224,13 @@ public void generateDownloadUrl(
182224 } else if (response instanceof Exception ) {
183225 responseObserver .onError (((Exception ) response ));
184226 } else {
185- responseObserver .onError (new IllegalArgumentException ("Unrecognized response type" ));
227+ responseObserver .onError (
228+ new IllegalArgumentException (
229+ String .format (
230+ "Unrecognized response type %s for method GenerateDownloadUrl, expected %s or %s" ,
231+ response .getClass ().getName (),
232+ GenerateDownloadUrlResponse .class .getName (),
233+ Exception .class .getName ())));
186234 }
187235 }
188236
@@ -196,7 +244,13 @@ public void setIamPolicy(SetIamPolicyRequest request, StreamObserver<Policy> res
196244 } else if (response instanceof Exception ) {
197245 responseObserver .onError (((Exception ) response ));
198246 } else {
199- responseObserver .onError (new IllegalArgumentException ("Unrecognized response type" ));
247+ responseObserver .onError (
248+ new IllegalArgumentException (
249+ String .format (
250+ "Unrecognized response type %s for method SetIamPolicy, expected %s or %s" ,
251+ response .getClass ().getName (),
252+ Policy .class .getName (),
253+ Exception .class .getName ())));
200254 }
201255 }
202256
@@ -210,7 +264,13 @@ public void getIamPolicy(GetIamPolicyRequest request, StreamObserver<Policy> res
210264 } else if (response instanceof Exception ) {
211265 responseObserver .onError (((Exception ) response ));
212266 } else {
213- responseObserver .onError (new IllegalArgumentException ("Unrecognized response type" ));
267+ responseObserver .onError (
268+ new IllegalArgumentException (
269+ String .format (
270+ "Unrecognized response type %s for method GetIamPolicy, expected %s or %s" ,
271+ response .getClass ().getName (),
272+ Policy .class .getName (),
273+ Exception .class .getName ())));
214274 }
215275 }
216276
@@ -226,7 +286,13 @@ public void testIamPermissions(
226286 } else if (response instanceof Exception ) {
227287 responseObserver .onError (((Exception ) response ));
228288 } else {
229- responseObserver .onError (new IllegalArgumentException ("Unrecognized response type" ));
289+ responseObserver .onError (
290+ new IllegalArgumentException (
291+ String .format (
292+ "Unrecognized response type %s for method TestIamPermissions, expected %s or %s" ,
293+ response .getClass ().getName (),
294+ TestIamPermissionsResponse .class .getName (),
295+ Exception .class .getName ())));
230296 }
231297 }
232298}
0 commit comments