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

Invalid Arguments Error name format check #52

Open
ifraixedes opened this issue Dec 21, 2022 · 0 comments
Open

Invalid Arguments Error name format check #52

ifraixedes opened this issue Dec 21, 2022 · 0 comments
Labels
crate:uplink Specific issues / PRs for uplink crate type:enhancement New feature or request

Comments

@ifraixedes
Copy link
Collaborator

ifraixedes commented Dec 21, 2022

The error::Args struct which is used for the error:Error::InvalidArguments variant specifies the format of the name field value.

error::Args::new constructor doesn't check the value of the passed argument to assign to the name field, so developers can use an invalid format without being aware of causing a bug. This format is useful for developers to find out to developers who use the uplink crate to understand that they are calling a public API with an invalid argument, so if the format is wrong it would cause confusion to the end developers.

Because passing an invalid name format is a bug, I was thinking that this should panic; returning a Result doesn't seem to make a lot of sense because how should this error have to be handled?. I understand that panic sounds a no-go for some people, but if the end developer gets a panic he will understand right away there is a bug in the crate and hopefully will open an issue and it will be fix quickly.

Find the place to add this check by searching in the sources TODO(https://github.com/storj-thirdparty/uplink-rust/issues/52).

@ifraixedes ifraixedes added type:enhancement New feature or request crate:uplink Specific issues / PRs for uplink crate labels Dec 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
crate:uplink Specific issues / PRs for uplink crate type:enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant