@@ -162,7 +162,7 @@ public void start(Map<String, String> props) {
162
162
}
163
163
164
164
@ Override
165
- public List <SourceRecord > poll () throws InterruptedException {
165
+ public List <SourceRecord > poll () throws ConnectException {
166
166
167
167
if (maxInterval > 0 ) {
168
168
try {
@@ -230,7 +230,7 @@ public List<SourceRecord> poll() throws InterruptedException {
230
230
return records ;
231
231
}
232
232
233
- private GenericRecord generateRecord () throws DatagenTaskException {
233
+ private GenericRecord generateRecord () throws ConnectException {
234
234
Future <Object > generatedObjectFuture = generateExecutor .submit (generator ::generate );
235
235
Long timeout = config .getGenerateTimeout ();
236
236
Object generatedObject ;
@@ -241,12 +241,12 @@ private GenericRecord generateRecord() throws DatagenTaskException {
241
241
generatedObject = generatedObjectFuture .get (timeout , TimeUnit .MILLISECONDS );
242
242
}
243
243
} catch (InterruptedException | ExecutionException e ) {
244
- throw new DatagenTaskException ("Unable to generate random record" , e );
244
+ throw new ConnectException ("Unable to generate random record" , e );
245
245
} catch (TimeoutException e ) {
246
- throw new DatagenTaskException ("Record generation timed out" , e );
246
+ throw new ConnectException ("Record generation timed out" , e );
247
247
}
248
248
if (!(generatedObject instanceof GenericRecord )) {
249
- throw new DatagenTaskException (String .format (
249
+ throw new ConnectException (String .format (
250
250
"Expected Avro Random Generator to return instance of GenericRecord, found %s instead" ,
251
251
generatedObject .getClass ().getName ()
252
252
));
0 commit comments