@@ -107,6 +107,8 @@ public void createSchedule(CreateScheduleInput input) {
107107 } else {
108108 throw new ScheduleException (e );
109109 }
110+ } catch (Exception e ) {
111+ throw new ScheduleException (e );
110112 }
111113 }
112114
@@ -153,7 +155,11 @@ public void backfillSchedule(BackfillScheduleInput input) {
153155 .setScheduleId (input .getScheduleId ())
154156 .setPatch (patch )
155157 .build ();
156- genericClient .patchSchedule (request );
158+ try {
159+ genericClient .patchSchedule (request );
160+ } catch (Exception e ) {
161+ throw new ScheduleException (e );
162+ }
157163 }
158164
159165 @ Override
@@ -164,7 +170,11 @@ public void deleteSchedule(DeleteScheduleInput input) {
164170 .setNamespace (clientOptions .getNamespace ())
165171 .setScheduleId (input .getScheduleId ())
166172 .build ();
167- genericClient .deleteSchedule (request );
173+ try {
174+ genericClient .deleteSchedule (request );
175+ } catch (Exception e ) {
176+ throw new ScheduleException (e );
177+ }
168178 }
169179
170180 @ Override
@@ -175,16 +185,20 @@ public DescribeScheduleOutput describeSchedule(DescribeScheduleInput input) {
175185 .setScheduleId (input .getScheduleId ())
176186 .build ();
177187
178- DescribeScheduleResponse response = genericClient .describeSchedule (request );
179- return new DescribeScheduleOutput (
180- new ScheduleDescription (
181- input .getScheduleId (),
182- scheduleRequestHeader .protoToScheduleInfo (response .getInfo ()),
183- scheduleRequestHeader .protoToSchedule (response .getSchedule ()),
184- Collections .unmodifiableMap (
185- SearchAttributesUtil .decode (response .getSearchAttributes ())),
186- response .getMemo ().getFieldsMap (),
187- clientOptions .getDataConverter ()));
188+ try {
189+ DescribeScheduleResponse response = genericClient .describeSchedule (request );
190+ return new DescribeScheduleOutput (
191+ new ScheduleDescription (
192+ input .getScheduleId (),
193+ scheduleRequestHeader .protoToScheduleInfo (response .getInfo ()),
194+ scheduleRequestHeader .protoToSchedule (response .getSchedule ()),
195+ Collections .unmodifiableMap (
196+ SearchAttributesUtil .decode (response .getSearchAttributes ())),
197+ response .getMemo ().getFieldsMap (),
198+ clientOptions .getDataConverter ()));
199+ } catch (Exception e ) {
200+ throw new ScheduleException (e );
201+ }
188202 }
189203
190204 @ Override
@@ -198,8 +212,11 @@ public void pauseSchedule(PauseScheduleInput input) {
198212 .setScheduleId (input .getScheduleId ())
199213 .setPatch (patch )
200214 .build ();
201-
202- genericClient .patchSchedule (request );
215+ try {
216+ genericClient .patchSchedule (request );
217+ } catch (Exception e ) {
218+ throw new ScheduleException (e );
219+ }
203220 }
204221
205222 @ Override
@@ -216,7 +233,11 @@ public void triggerSchedule(TriggerScheduleInput input) {
216233 .setScheduleId (input .getScheduleId ())
217234 .setPatch (patch )
218235 .build ();
219- genericClient .patchSchedule (request );
236+ try {
237+ genericClient .patchSchedule (request );
238+ } catch (Exception e ) {
239+ throw new ScheduleException (e );
240+ }
220241 }
221242
222243 @ Override
@@ -230,7 +251,11 @@ public void unpauseSchedule(UnpauseScheduleInput input) {
230251 .setScheduleId (input .getScheduleId ())
231252 .setPatch (patch )
232253 .build ();
233- genericClient .patchSchedule (request );
254+ try {
255+ genericClient .patchSchedule (request );
256+ } catch (Exception e ) {
257+ throw new ScheduleException (e );
258+ }
234259 }
235260
236261 @ Override
@@ -249,6 +274,10 @@ public void updateSchedule(UpdateScheduleInput input) {
249274 .setRequestId (UUID .randomUUID ().toString ())
250275 .setSchedule (scheduleRequestHeader .scheduleToProto (schedule .getSchedule ()))
251276 .build ();
252- genericClient .updateSchedule (request );
277+ try {
278+ genericClient .updateSchedule (request );
279+ } catch (Exception e ) {
280+ throw new ScheduleException (e );
281+ }
253282 }
254283}
0 commit comments