Nested errors no longer print "inner service error:" or similar (#56)

This commit is contained in:
Eliza Weisman 2018-02-27 15:36:44 -08:00 committed by Carl Lerche
parent 1efa622b6e
commit 8acbfa80ee
6 changed files with 11 additions and 21 deletions

View File

@ -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"),

View File

@ -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"),
}
}
}

View File

@ -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"),
}
}
}

View File

@ -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"),
}

View File

@ -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"),
}
}

View File

@ -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",
}
}