Giter VIP home page Giter VIP logo

Comments (2)

mdecimus avatar mdecimus commented on May 24, 2024

Not sure how to interpret that message, both Debug and Display are implemented in mail-send's Error.
Perhaps you could wrap mail-send's Error into your own error type that supports thiserror?

from mail-send.

LeoniePhiline avatar LeoniePhiline commented on May 24, 2024

The problem here was that the std::error::Error trait is not implemented for mail_send::Error. I've opened #11 about that.

Here's a better error message to showcase the issue
(note the the following trait bounds were not satisfied: mail_send::Error: std::error::Error):

error[E0599]: the method `as_dyn_error` exists for reference `&mail_send::Error`, but its trait bounds were not satisfied
   --> mail/src/error.rs:15:13
    |
15  |     #[error("failed to send mail")]
    |             ^^^^^^^^^^^^^^^^^^^^^ method cannot be called on `&mail_send::Error` due to unsatisfied trait bounds
    |
   ::: /path/to/.cargo/registry/src/github.com-1ecc6299db9ec823/mail-send-0.3.1/src/lib.rs:139:1
    |
139 | pub enum Error {
    | --------------
    | |
    | doesn't satisfy `mail_send::Error: AsDynError<'_>`
    | doesn't satisfy `mail_send::Error: std::error::Error`
    |
    = note: the following trait bounds were not satisfied:
            `mail_send::Error: std::error::Error`
            which is required by `mail_send::Error: AsDynError<'_>`
            `&mail_send::Error: std::error::Error`
            which is required by `&mail_send::Error: AsDynError<'_>`

There is a workaround (using .map_err() rather than #[from] with #[error("description")]), but it could be real neat if the standardized std::error::Error trait was supported, as the mainstream error handling libraries build upon it and it makes life easier. :)

from mail-send.

Related Issues (11)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.