1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// Copyright 2020 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.

use super::listener::ListenerError;
use crate::events::error::EventError;
use thiserror::Error;

#[derive(Debug, Error)]
pub enum LogsError {
    #[error("couldn't connect to {protocol}: {source}")]
    ConnectingToService { protocol: &'static str, source: anyhow::Error },

    #[error("couldn't retrieve the ReadOnlyLog debuglog handle: {source}")]
    RetrievingDebugLog { source: fidl::Error },

    #[error("malformed event: `{source}`")]
    MalformedEvent {
        #[from]
        source: EventError,
    },

    #[error("error while handling {protocol} requests: {source}")]
    HandlingRequests { protocol: &'static str, source: fidl::Error },

    #[error("error from a listener: {source}")]
    Listener {
        #[from]
        source: ListenerError,
    },
}