1111from pynumaflow .proto .sourcer import source_pb2
1212from pynumaflow .proto .sourcer import source_pb2_grpc
1313from pynumaflow .types import NumaflowServicerContext
14- from pynumaflow ._constants import _LOGGER , STREAM_EOF , ERR_SOURCE_EXCEPTION
14+ from pynumaflow ._constants import _LOGGER , STREAM_EOF , ERR_UDF_EXCEPTION_STRING
1515
1616
1717def _create_read_handshake_response ():
@@ -119,7 +119,7 @@ async def ReadFn(
119119 yield _create_eot_response ()
120120 except BaseException as err :
121121 _LOGGER .critical ("User-Defined Source ReadFn error" , exc_info = True )
122- await handle_async_error (context , err , ERR_SOURCE_EXCEPTION )
122+ await handle_async_error (context , err , ERR_UDF_EXCEPTION_STRING )
123123
124124 async def __invoke_read (self , req , niter ):
125125 """Invoke the read handler and manage the iterator."""
@@ -165,7 +165,7 @@ async def AckFn(
165165 yield _create_ack_response ()
166166 except BaseException as err :
167167 _LOGGER .critical ("User-Defined Source AckFn error" , exc_info = True )
168- await handle_async_error (context , err , ERR_SOURCE_EXCEPTION )
168+ await handle_async_error (context , err , ERR_UDF_EXCEPTION_STRING )
169169
170170 async def IsReady (
171171 self , request : _empty_pb2 .Empty , context : NumaflowServicerContext
@@ -187,7 +187,7 @@ async def PendingFn(
187187 count = await self .__source_pending_handler ()
188188 except BaseException as err :
189189 _LOGGER .critical ("PendingFn Error" , exc_info = True )
190- await handle_async_error (context , err , ERR_SOURCE_EXCEPTION )
190+ await handle_async_error (context , err , ERR_UDF_EXCEPTION_STRING )
191191 return
192192 resp = source_pb2 .PendingResponse .Result (count = count .count )
193193 return source_pb2 .PendingResponse (result = resp )
@@ -202,7 +202,7 @@ async def PartitionsFn(
202202 partitions = await self .__source_partitions_handler ()
203203 except BaseException as err :
204204 _LOGGER .critical ("PartitionsFn Error" , exc_info = True )
205- await handle_async_error (context , err , ERR_SOURCE_EXCEPTION )
205+ await handle_async_error (context , err , ERR_UDF_EXCEPTION_STRING )
206206 return
207207 resp = source_pb2 .PartitionsResponse .Result (partitions = partitions .partitions )
208208 return source_pb2 .PartitionsResponse (result = resp )
0 commit comments