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

Improve error message for duplicated canonical info-hash #776

Open
Tracked by #521
josecelano opened this issue Nov 25, 2024 · 0 comments
Open
Tracked by #521

Improve error message for duplicated canonical info-hash #776

josecelano opened this issue Nov 25, 2024 · 0 comments
Labels
- User - Enjoyable to Use our Software Easy Good for Newcomers Enhancement / Feature Request Something New

Comments

@josecelano
Copy link
Member

Parent: #521

When you upload a torrent, you can get an error because there is already another torrent with the same canonical info-hash. The error doesn't give you the pre-existing torrent infohash.

The error:

    #[display(fmt = "A torrent with the same canonical infohash already exists in our database.")]
    CanonicalInfoHashAlreadyExists,

should give you the info-hash, so the user can search/navigate to see the pre-existing torrent.

We can do it like we do for other error enums with the thiserror crate.

use thiserror::Error;

#[derive(Debug, Error)]
pub enum ServiceError {
    #[error("internal server error: {0}")]
    InternalServerError(String),
    // other variants...
}
@josecelano josecelano added Enhancement / Feature Request Something New Easy Good for Newcomers - User - Enjoyable to Use our Software labels Nov 25, 2024
@josecelano josecelano changed the title Improve error message for duplciated canonical ingo-hash Improve error message for duplicated canonical info-hash Nov 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
- User - Enjoyable to Use our Software Easy Good for Newcomers Enhancement / Feature Request Something New
Projects
None yet
Development

No branches or pull requests

1 participant