-
Notifications
You must be signed in to change notification settings - Fork 602
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve error handling in BytesQueue.Push function in queue.go #400
Comments
@akanchha25 Indeed it's a good improvement. Do you think errors should be unexpeorted? If we export them then they could be used to check for given error like with |
@janisz That's a great point. Exporting the errors would indeed allow for more robust error handling, similar to checking for specific errors like io.EOF. This could be beneficial for users of the BytesQueue package to handle different error scenarios more explicitly. I can update the code to export these error variables, making it easier for others to handle specific error conditions. I'll proceed with the changes if that sounds good to you. |
Hi @akanchha25 @janisz . Guys i think bundling and seperating all error logs in a different go file like bytes_queue_error_logs.go would make it easy for us to keep all error logs in a single place and then export them directly in different functions or files for queue package. Would love to know your thoughts on this and if required, would like to work on adding this functionality if you could assign me this task. |
The Push function in BytesQueue currently uses a generic error message when the queue is full. It is suggested to use errFullQueue for a more descriptive error message.
Current Code:
Push function
Updated code
This will improve the code quality
The text was updated successfully, but these errors were encountered: