Skip to content

Conversation

@idonaaman123
Copy link
Contributor

No description provided.

if not self.is_connection_active:
raise MemphisError("Connection is dead")
if batch_size > self.MAX_BATCH_SIZE:
raise MemphisError(f"Batch size parameter should be with value of {self.MAX_BATCH_SIZE} maximum!")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change the message to be as I write in the js sdk comments

if not self.is_connection_active:
raise MemphisError("Cant fetch messages without being connected!")
if batch_size > self.MAX_BATCH_SIZE:
raise MemphisError(f"Batch size parameter should be with value of {self.MAX_BATCH_SIZE} maximum!")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change the message to be as I write in the js sdk comments

except Exception as e:
await self.dls_callback_func([], MemphisError(str(e)), self.context)
return
if self.dls_callback_func != None:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you explain why you did it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

when you call to Fetch function, you dont pass callback parameter. you can pass only batch_size parameter. there is function calls __consume_dls which run when the sdk start. when i put the raise error of the batch_size in Fetch function, the consume_dls function fall and go the the execpt where the callback is called. but in Fetch function there is not callback function so the code is fail. i put this if to check if there is a callback function to avoid this situation .

if self.connection.is_connection_active:
try:
if batch_size > self.MAX_BATCH_SIZE:
raise MemphisError(f"Batch size parameter should be with value of {self.MAX_BATCH_SIZE} maximum!")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change the message to be as I write in the js sdk comments

@idanasulin2706 idanasulin2706 merged commit a448492 into master Apr 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants