Skip to content
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

Export RedisError to SWIG wrapper. #820

Merged
merged 3 commits into from
Jan 11, 2024

Conversation

liuh-80
Copy link
Contributor

@liuh-80 liuh-80 commented Sep 15, 2023

Why I did it

RedisError class and other class defined in redisreply.h can't be used in python.
This is bcause redisreply.h nor gnerate SWIG wrapper.

How I did it

Add redisreply.h to swsscommon.i for generate SWIG wrapper.

How to verify it

Pass all UT and E2E test cases.
Manually check the classes in redisreply.h exist in SWIG wrapper.

Which release branch to backport (provide reason below if selected)

  • 201811
  • 201911
  • 202006
  • 202012
  • 202106
  • 202111

Description for the changelog

Add redisreply.h to swsscommon.i for generate SWIG wrapper.

Link to config_db schema for YANG module changes

A picture of a cute animal (not mandatory but encouraged)

@liuh-80 liuh-80 marked this pull request as ready for review September 15, 2023 02:05
ganglyu
ganglyu previously approved these changes Sep 15, 2023
@liuh-80 liuh-80 changed the title Add redisreply.h to swsscommon.i for generate SWIG wrapper. Imporove swss-common exception from text and runtime_error to RedisError. Nov 27, 2023
@liuh-80 liuh-80 changed the title Imporove swss-common exception from text and runtime_error to RedisError. Improve swss-common exception from text and runtime_error to RedisError. Nov 28, 2023
@liuh-80
Copy link
Contributor Author

liuh-80 commented Jan 9, 2024

/azpw run Azure.sonic-buildimage

@mssonicbld
Copy link
Collaborator

/AzurePipelines run Azure.sonic-buildimage

Copy link

No pipelines are associated with this pull request.

@@ -90,7 +90,7 @@ void ConsumerTable::pops(deque<KeyOpFieldsValuesTuple> &vkco, const string &pref
if (i+1 >= ctx->elements)
{
SWSS_LOG_ERROR("invalid number of elements in returned table: %zu >= %zu", i+1, ctx->elements);
throw runtime_error("invalid number of elements in returned table");
throw RedisError("invalid number of elements in returned table");
Copy link
Contributor

Choose a reason for hiding this comment

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

RedisError

changing very old exception type will be dangerous, since the library is used by too many applications, and they may catch by some exception class in a chain.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed, revert to first commit to only export RedisError class.

@liuh-80 liuh-80 force-pushed the dev/liuh/export-redisreply branch from 70359a3 to 54c6839 Compare January 9, 2024 02:15
@liuh-80 liuh-80 changed the title Improve swss-common exception from text and runtime_error to RedisError. Export RedisError to SWIG wrapper. Jan 9, 2024
@liuh-80 liuh-80 merged commit b563580 into sonic-net:master Jan 11, 2024
14 checks passed
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.

4 participants