mirror of
https://github.com/tower-rs/tower.git
synced 2025-10-02 15:25:11 +00:00
Nested errors no longer print "inner service error:" or similar (#56)
This commit is contained in:
parent
1efa622b6e
commit
8acbfa80ee
@ -323,8 +323,7 @@ where
|
||||
{
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
match *self {
|
||||
Error::Inner(ref why) =>
|
||||
write!(f, "inner service error: {}", why),
|
||||
Error::Inner(ref why) => fmt::Display::fmt(why, f),
|
||||
Error::Balance(ref why) =>
|
||||
write!(f, "load balancing failed: {}", why),
|
||||
Error::NotReady => f.pad("not ready"),
|
||||
|
@ -232,10 +232,8 @@ where
|
||||
{
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
match *self {
|
||||
Error::Inner(ref why) =>
|
||||
write!(f, "inner service error: {}", why),
|
||||
Error::Closed =>
|
||||
write!(f, "buffer closed"),
|
||||
Error::Inner(ref why) => fmt::Display::fmt(why, f),
|
||||
Error::Closed => f.pad("buffer closed"),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -252,10 +252,8 @@ where
|
||||
{
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
match *self {
|
||||
Error::Upstream(ref why) =>
|
||||
write!(f, "upstream service error: {}", why),
|
||||
Error::NoCapacity =>
|
||||
write!(f, "in-flight limit exceeded"),
|
||||
Error::Upstream(ref why) => fmt::Display::fmt(why, f),
|
||||
Error::NoCapacity => write!(f, "in-flight limit exceeded"),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -183,8 +183,7 @@ where
|
||||
{
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
match *self {
|
||||
Error::Upstream(ref why) =>
|
||||
write!(f, "upstream service error: {}", why),
|
||||
Error::Upstream(ref why) => fmt::Display::fmt(why, f)
|
||||
Error::NoCapacity =>
|
||||
write!(f, "rate limit exceeded"),
|
||||
}
|
||||
|
@ -172,10 +172,8 @@ where
|
||||
{
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
match *self {
|
||||
Error::Inner(ref why) =>
|
||||
write!(f, "inner service error: {}", why),
|
||||
Error::Connect(ref why) =>
|
||||
write!(f, "connection failed: {}", why),
|
||||
Error::Inner(ref why) => fmt::Display::fmt(why, f),
|
||||
Error::Connect(ref why) => write!(f, "connection failed: {}", why),
|
||||
Error::NotReady => f.pad("not ready"),
|
||||
}
|
||||
}
|
||||
|
@ -106,10 +106,8 @@ where
|
||||
{
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
match *self {
|
||||
Error::Inner(ref why) =>
|
||||
write!(f, "inner service error: {}", why),
|
||||
Error::Timeout =>
|
||||
write!(f, "request timed out"),
|
||||
Error::Inner(ref why) => fmt::Display::fmt(why, f),
|
||||
Error::Timeout => f.pad("request timed out"),
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -129,7 +127,7 @@ where
|
||||
fn description(&self) -> &str {
|
||||
match *self {
|
||||
Error::Inner(_) => "inner service error",
|
||||
Error::NoCapacity => "request timed out",
|
||||
Error::Timeout => "request timed out",
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user