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

Small things #37

Merged
merged 5 commits into from
Feb 8, 2025
Merged

Small things #37

merged 5 commits into from
Feb 8, 2025

Conversation

oroulet
Copy link
Member

@oroulet oroulet commented Feb 2, 2025

No description provided.

Copy link
Contributor

@einarmo einarmo left a comment

Choose a reason for hiding this comment

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

Mostly good, some nit, and I would rather we not remove the RelativePathError without good cause. Sure, reducing the number of errors is nice, but OpcUaError might quickly grow very large if we include all possible error modes from all possible functions in it. It's probably better for the future to have individual error enums where it makes sense, then just include those in OpcUaError. Doing so is easy with thiserror anyway.

async-opcua-types/src/impls.rs Show resolved Hide resolved
async-opcua-types/src/impls.rs Show resolved Hide resolved
@@ -340,21 +382,6 @@ impl RelativePathElement {
}
}

#[derive(Debug, Clone)]
/// Error returned from parsing a relative path.
pub enum RelativePathError {
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, instead of removing this error, just imlement From<RelativePathError> for OpcUaError? I don't see a good reason to flatten the error now.

Do feel free to derive Error on RelativePathError, just using the docstrings as error messages.

Copy link
Member Author

Choose a reason for hiding this comment

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

yes might be. I was unsure what the correct approach is here. I just proposed something.
And yes maybe From<RelativePathError> for OpcUaError is a good solution.
I will change that

@oroulet oroulet force-pushed the smallthings branch 2 times, most recently from d304b29 to 56786bc Compare February 4, 2025 18:43
Copy link
Contributor

@einarmo einarmo left a comment

Choose a reason for hiding this comment

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

Would be nice to include the actual content of the error in the messages, maybe?

async-opcua-types/src/errors.rs Outdated Show resolved Hide resolved
async-opcua-types/src/errors.rs Outdated Show resolved Hide resolved
async-opcua-types/src/errors.rs Outdated Show resolved Hide resolved
Copy link
Contributor

@einarmo einarmo left a comment

Choose a reason for hiding this comment

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

LGTM!

@oroulet oroulet merged commit 285adbf into master Feb 8, 2025
6 checks passed
@oroulet oroulet deleted the smallthings branch February 8, 2025 09:31
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.

2 participants