summaryrefslogtreecommitdiffstats
path: root/src/endpoint/configured.rs
diff options
context:
space:
mode:
authorMatthias Beyer <mail@beyermatthias.de>2020-11-06 16:23:46 +0100
committerMatthias Beyer <mail@beyermatthias.de>2020-11-07 14:53:04 +0100
commit72a00593c4c8348804fbd9d4fac025ffe15b093a (patch)
treed5dc66de1bf1e781cd82f7c63af45c31a62b744a /src/endpoint/configured.rs
parent0d02347c8d1ea612c112430985723c57c105facd (diff)
Add more error context messages in job running routine
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Diffstat (limited to 'src/endpoint/configured.rs')
-rw-r--r--src/endpoint/configured.rs10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/endpoint/configured.rs b/src/endpoint/configured.rs
index d3dc2a3..8690421 100644
--- a/src/endpoint/configured.rs
+++ b/src/endpoint/configured.rs
@@ -219,12 +219,18 @@ impl Endpoint {
buffer_stream_to_line_stream(stream)
.map(|line| {
trace!("['{}':{}] Found log line: {:?}", self.name, container_id, line);
- line.map_err(Error::from)
+ line.with_context(|| anyhow!("Getting log from {}:{}", self.name, container_id))
+ .map_err(Error::from)
.and_then(|l| {
crate::log::parser()
.parse(l.as_bytes())
+ .with_context(|| anyhow!("Parsing log from {}:{}: {:?}", self.name, container_id, l))
.map_err(Error::from)
- .and_then(|item| logsink.send(item).map_err(Error::from))
+ .and_then(|item| {
+ logsink.send(item)
+ .with_context(|| anyhow!("Sending log to log sink"))
+ .map_err(Error::from)
+ })
})
})
.collect::<Result<Vec<_>>>()