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

RUST-1913 Compilation error when handling ErrorKind::GridFs #1071

Closed
rigens opened this issue Apr 10, 2024 · 1 comment
Closed

RUST-1913 Compilation error when handling ErrorKind::GridFs #1071

rigens opened this issue Apr 10, 2024 · 1 comment
Assignees
Labels
tracked-in-jira Ticket filed in Mongo's Jira system

Comments

@rigens
Copy link

rigens commented Apr 10, 2024

Versions/Environment

  1. What version of Rust are you using?
    rustc 1.77.2 (25ef9e3d8 2024-04-09)
  2. What operating system are you using?
    Ubuntu 20.04
  3. What versions of the driver and its dependencies are you using? (Run
    cargo pkgid mongodb & cargo pkgid bson)
    [email protected]
  4. What version of MongoDB are you using? (Check with the MongoDB shell using db.version())
    4.2.2
  5. What is your MongoDB topology (standalone, replica set, sharded cluster, serverless)?
    standalone

Describe the bug

I get a compilation error when handling ErrorKind::GridFs error

    let client = Client::with_uri_str("mongodb://localhost:27017/test").await.unwrap();
    let db = client.default_database().unwrap();
    let bucket = db.gridfs_bucket(None);
    
    let res = bucket.delete(Bson::String("1234567".to_string())).await;
    
    match res {
        Ok(_) => {println!("ok")}
        Err(err) => {
            match *err.kind {
                ErrorKind::GridFs(_) => {println!("gridfs error")}
                _ => {println!("other mongodb error")}
            }
        }
    }
    |
130 |                 ErrorKind::GridFs(_) => {println!("gridfs error")}
    |                            ^^^^^^ private tuple variant
    |
    |
573 |     #[non_exhaustive]
    |     ----------------- cannot be constructed because it is `#[non_exhaustive]`
574 |     GridFs(GridFsErrorKind),
    |     ^^^^^^
@abr-egn abr-egn changed the title Compilation error when handling ErrorKind::GridFs RUST-1913 Compilation error when handling ErrorKind::GridFs Apr 16, 2024
@abr-egn abr-egn added tracked-in-jira Ticket filed in Mongo's Jira system and removed triage labels Apr 16, 2024
@abr-egn
Copy link
Contributor

abr-egn commented Apr 16, 2024

Thanks for the bug report! I've just merged #1080 to fix this.

@abr-egn abr-egn closed this as completed Apr 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tracked-in-jira Ticket filed in Mongo's Jira system
Projects
None yet
Development

No branches or pull requests

2 participants