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

Unclear error message for #192 #193

Closed
qsantos opened this issue Dec 8, 2023 · 3 comments
Closed

Unclear error message for #192 #193

qsantos opened this issue Dec 8, 2023 · 3 comments
Labels
bug Reports or fixes associated with bugs in this project complexity::low Issues or ideas with a low implementation cost component::cli Everything related to the buffrs cli docs::project Documenting the project vision, design decisions etc priority::high Urgent change or idea, please review quickly

Comments

@qsantos
Copy link
Contributor

qsantos commented Dec 8, 2023

From #192:

~% git clone git@github..........
~% cd my-project
~/my-project% buffrs install
Error:   × failed to install dependencies for `my-project`
  ╰─▶ No such file or directory (os error 2)

The error message does not help understanding that the issue comes from the missing proto/vendor/ directory.

@qsantos
Copy link
Contributor Author

qsantos commented Dec 14, 2023

The error message comes from:

let meta = fs::metadata(&self.proto_path()).await.into_diagnostic()?;

The core::result::Result returned by the Future is converted into a miette::Result but no context message is attached.

Would it make sense to require that any call to into_diagnostic() be followed by a call to wrap_err()? Maybe we could make a lint for that.

@qsantos
Copy link
Contributor Author

qsantos commented Dec 14, 2023

Note, however, that the full function is:

/// Check if this store exists
async fn exists(&self) -> miette::Result<bool> {
let meta = fs::metadata(&self.proto_path()).await.into_diagnostic()?;
Ok(meta.is_dir())
}

This function will only return Ok(false) if the entry exists but is not a directory. In this case, maybe it would make more sense to do:

    /// Check if this store exists
    async fn exists(&self) -> bool {
        fs::metadata(&self.proto_path()).await.is_ok_and(|meta| meta.is_dir())
    }

@mara-schulke mara-schulke added bug Reports or fixes associated with bugs in this project complexity::low Issues or ideas with a low implementation cost component::cli Everything related to the buffrs cli priority::high Urgent change or idea, please review quickly docs::project Documenting the project vision, design decisions etc labels Dec 14, 2023
@qsantos qsantos removed their assignment May 3, 2024
@gbouv
Copy link
Contributor

gbouv commented Jul 3, 2024

This seems to be fixed right? I tried to repro and now buffrs automatically create the proto/vendor directory. Can this issue be closed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Reports or fixes associated with bugs in this project complexity::low Issues or ideas with a low implementation cost component::cli Everything related to the buffrs cli docs::project Documenting the project vision, design decisions etc priority::high Urgent change or idea, please review quickly
Projects
None yet
Development

No branches or pull requests

3 participants