archivist_lib/logs/
error.rs

1// Copyright 2020 The Fuchsia Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
3
4use super::listener::ListenerError;
5use crate::events::error::EventError;
6use thiserror::Error;
7
8#[derive(Debug, Error)]
9pub enum LogsError {
10    #[error("couldn't connect to {protocol}: {source}")]
11    ConnectingToService { protocol: &'static str, source: anyhow::Error },
12
13    #[error("couldn't retrieve the ReadOnlyLog debuglog handle: {source}")]
14    RetrievingDebugLog { source: fidl::Error },
15
16    #[error("malformed event: `{source}`")]
17    MalformedEvent {
18        #[from]
19        source: EventError,
20    },
21
22    #[error("error while handling {protocol} requests: {source}")]
23    HandlingRequests { protocol: &'static str, source: fidl::Error },
24
25    #[error("error from a listener: {source}")]
26    Listener {
27        #[from]
28        source: ListenerError,
29    },
30}