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

Swss common exceptions #42

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

erer1243
Copy link
Collaborator

@erer1243 erer1243 commented Jan 16, 2025

First 4 commits are from swss-common table pr :P

Closes #10

@erer1243 erer1243 requested a review from Copilot January 16, 2025 20:04
@mssonicbld
Copy link

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Choose a reason for hiding this comment

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

Copilot reviewed 5 out of 16 changed files in this pull request and generated no comments.

Files not reviewed (11)
  • crates/swss-common/src/types/zmqserver.rs: Evaluated as low risk
  • crates/swss-common/src/types/zmqconsumerstatetable.rs: Evaluated as low risk
  • crates/swss-common/tests/common.rs: Evaluated as low risk
  • crates/swss-common/tests/async.rs: Evaluated as low risk
  • crates/swss-common/src/types/table.rs: Evaluated as low risk
  • crates/swss-common/src/types/zmqproducerstatetable.rs: Evaluated as low risk
  • crates/swss-common/src/types/subscriberstatetable.rs: Evaluated as low risk
  • crates/swss-common/src/types/zmqclient.rs: Evaluated as low risk
  • crates/swss-common/src/types/cxxstring.rs: Evaluated as low risk
  • crates/swss-common/src/lib.rs: Evaluated as low risk
  • crates/swss-common/src/types/consumerstatetable.rs: Evaluated as low risk
Comments suppressed due to low confidence (6)

crates/swss-common/src/types/producerstatetable.rs:12

  • [nitpick] The function name new is ambiguous. It should be renamed to new_with_result.
pub fn new(db: DbConnector, table_name: &str) -> Result<Self> {

crates/swss-common/src/types/producerstatetable.rs:18

  • [nitpick] The function name set_buffered is ambiguous. It should be renamed to set_buffered_with_result.
pub fn set_buffered(&self, buffered: bool) -> Result<()> {

crates/swss-common/src/types/dbconnector.rs:30

  • The error message in the DbConnector::new function should be consistent with the rest of the codebase.
Exception::try1(|p_db| SWSSDBConnector_new_tcp(db_id, hostname.as_ptr(), *port, timeout_ms, p_db))?

crates/swss-common/src/types/dbconnector.rs:36

  • The error message in the DbConnector::new function should be consistent with the rest of the codebase.
Exception::try1(|p_db| SWSSDBConnector_new_unix(db_id, sock_path.as_ptr(), timeout_ms, p_db))?

crates/swss-common/src/types/dbconnector.rs:83

  • The error message in the DbConnector::set function should be consistent with the rest of the codebase.
unsafe { Exception::try0(SWSSDBConnector_set(self.ptr, key.as_ptr(), val.as_raw())) }

crates/swss-common/src/types/dbconnector.rs:113

  • The error message in the DbConnector::hset function should be consistent with the rest of the codebase.
Exception::try0(SWSSDBConnector_hset(self.ptr, key.as_ptr(), field.as_ptr(), val.as_raw()))
@erer1243
Copy link
Collaborator Author

Those copilot reviews don't really make sense

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.

Decide how to pass exceptions across the C API (tracking swss-common/#932)
2 participants