File tree Expand file tree Collapse file tree 1 file changed +14
-5
lines changed Expand file tree Collapse file tree 1 file changed +14
-5
lines changed Original file line number Diff line number Diff line change @@ -207,11 +207,20 @@ where
207207 fn from_config_and_context ( config : & ClientConfig , context : C ) -> KafkaResult < Self > {
208208 let native_config = config. create_native_config ( ) ?;
209209 let poll_interval = {
210- let millis: u64 = native_config
211- . get ( "max.poll.interval.ms" ) ?
212- . parse ( )
213- . expect ( "librdkafka validated config value is valid u64" ) ;
214- Duration :: from_millis ( millis)
210+ let millis = native_config. get ( "max.poll.interval.ms" ) ?;
211+ match millis. parse ( ) {
212+ Ok ( millis) => Duration :: from_millis ( millis) ,
213+ Err ( e) => {
214+ println ! ( "Config string: '{}'" , millis) ;
215+ println ! ( "Error: '{}'" , e) ;
216+ return Err ( KafkaError :: ClientConfig (
217+ RDKafkaConfRes :: RD_KAFKA_CONF_INVALID ,
218+ "max.poll.interval.ms" . to_string ( ) ,
219+ format ! ( "Invalid integer: {}" , e) ,
220+ millis,
221+ ) ) ;
222+ }
223+ }
215224 } ;
216225
217226 let base = Arc :: new ( BaseConsumer :: new ( config, native_config, context) ?) ;
You can’t perform that action at this time.
0 commit comments