Comments (2)
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.
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)
- ✨ Feature request: OpenPGP encryption support HOT 18
- thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: MissingStartTls HOT 7
- Add an `impl std::error::Error` for `mail_send::Error` HOT 4
- `UnparseableReply`: Bug in `impl<T: AsyncRead + AsyncWrite + Unpin> SmtpClient<T>`. (Fixed by #13) HOT 5
- Sample Usage using XOAuth2 for SMTP Sending of Email HOT 2
- Disable SSL/TLS HOT 1
- Non-async support? HOT 4
- Integration with mail-parser HOT 3
- Fails to compile (Even in hello world) HOT 1
- Send gets stuck when the message has a binary attachment HOT 10
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mail-send.