Comments (4)
I just found the backtrace
feature in proto
- I guess the idea is that would provide context in debug builds. I actually went through the documentation before posting this and didn't see it mentioned anywhere.
It adds debug information to error objects when RUST_BACKTRACE=1
, both {}
and {:?}
. I don't know if this is debug builds only.
That said, I just tried it and the backtrace dies in the middle of async land:
0: <hickory_proto::error::ProtoError as core::convert::From<E>>::from
at .../.cargo/registry/src/index.crates.io-6f17d22bba15001f/hickory-proto-0.24.0/src/error.rs:359:24
1: core::ops::function::FnOnce::call_once
at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/core/src/ops/function.rs:250:5
2: <T as futures_util::fns::FnOnce1<A>>::call_once
at .../.cargo/registry/src/index.crates.io-6f17d22bba15001f/futures-util-0.3.30/src/fns.rs:15:9
3: <futures_util::fns::MapErrFn<F> as futures_util::fns::FnOnce1<core::result::Result<T,E>>>::call_once::{{closure}}
at .../.cargo/registry/src/index.crates.io-6f17d22bba15001f/futures-util-0.3.30/src/fns.rs:219:25
4: core::result::Result<T,E>::map_err
at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/core/src/result.rs:829:27
5: <futures_util::fns::MapErrFn<F> as futures_util::fns::FnOnce1<core::result::Result<T,E>>>::call_once
at .../.cargo/registry/src/index.crates.io-6f17d22bba15001f/futures-util-0.3.30/src/fns.rs:219:9
6: <futures_util::future::future::map::Map<Fut,F> as core::future::future::Future>::poll
at .../.cargo/registry/src/index.crates.io-6f17d22bba15001f/futures-util-0.3.30/src/future/future/map.rs:57:73
7: <futures_util::future::future::Map<Fut,F> as core::future::future::Future>::poll
at .../.cargo/registry/src/index.crates.io-6f17d22bba15001f/futures-util-0.3.30/src/lib.rs:91:13
8: <futures_util::future::try_future::MapErr<Fut,F> as core::future::future::Future>::poll
at .../.cargo/registry/src/index.crates.io-6f17d22bba15001f/futures-util-0.3.30/src/lib.rs:91:13
9: <core::pin::Pin<P> as core::future::future::Future>::poll
at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/core/src/future/future.rs:125:9
10: <core::pin::Pin<P> as core::future::future::Future>::poll
at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/core/src/future/future.rs:125:9
11: futures_util::future::future::FutureExt::poll_unpin
at .../.cargo/registry/src/index.crates.io-6f17d22bba15001f/futures-util-0.3.30/src/future/future/mod.rs:558:9
12: <hickory_proto::xfer::dns_multiplexer::DnsMultiplexerConnect<F,S,MF> as core::future::future::Future>::poll
at .../.cargo/registry/src/index.crates.io-6f17d22bba15001f/hickory-proto-0.24.0/src/xfer/dns_multiplexer.rs:241:32
13: <hickory_proto::xfer::dns_exchange::DnsExchangeConnectInner<F,S,TE> as core::future::future::Future>::poll
at .../.cargo/registry/src/index.crates.io-6f17d22bba15001f/hickory-proto-0.24.0/src/xfer/dns_exchange.rs:322:27
14: futures_util::future::future::FutureExt::poll_unpin
Perhaps this is an internal error, but I feel like it should say something like "error trying to call connect
" or something that could tie it to the a specific call or point in the source.
from hickory-dns.
It looks like there actually is context associated with io::Error
, but it's discarded when converted to ProtoError
(only kind
is kept).
from hickory-dns.
I think I looked into this once, and std actually doesn't provide APIs to keep the context around?
from hickory-dns.
Oops, my brain purged my cache. I'm trying to remember what I found when I was digging in...
std::io::Error
wraps an error in addition to the Kind
, ex Error::new(ErrorKind::Other, "oh no!")
. Looking at the docs I think this may be exposed by into_inner
?
In this case I believe the error conversion path was io::Error
-> ProtoErrorKind
-> ProtoError
which discards the inner error... I think there were any other error conversions before it was returned.
It looks like the standard library mostly uses const_io_error!
macro which is exposed in .description()
. Edit: description
is deprecated and it says to use Display
methods now.
But in any case the more context that could be preserved (and possibly supplemented) in ProtoError
the easier it'd make troubleshooting.
from hickory-dns.
Related Issues (20)
- Low level send method in resolver HOT 8
- impl RecordData for RData HOT 1
- Update rustls to latest version HOT 2
- Add the ability to bind/unbind ports dynamically
- Introduce TlsConnect and QuicConnect trait to be more flexible HOT 4
- Resolver couldn't handle response that have lots of records HOT 13
- tokio::JoinSet and hickory_resolver::Resolver causes "Cannot start a runtime from within a runtime" HOT 2
- Forwarder seems to not use /etc/hosts despite `use_hosts_file == true` HOT 3
- Presence of a faulty nameserver in system config causes client side lookups to take forever HOT 1
- Reverse lookup fails when there are multiple PTR records HOT 1
- www.hickory-dns.org does not work - 404 HOT 5
- SIG(0) RFC2931 is not listed as supported HOT 1
- Missing point of contact for security issues HOT 3
- `IN` keyword is not accepted HOT 2
- Request for a wildcard with ANY returns nothing HOT 2
- Handle sockets that have been shut down HOT 5
- Make ```hickory_proto::quic::QuicClientStream``` clonable
- why hickory-proto 0.24.1 ring dependencies is still 0.16.20 HOT 4
- Not convenient to call bind_with_addr to make a AsyncResolver HOT 4
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 hickory-dns.