1// Copyright 2024 The Fuchsia Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4use fidl_fuchsia_component as fcomponent;
56#[derive(Debug, thiserror::Error)]
7pub enum Error {
8#[error(
9"namespace {prefix} should have exactly one entry but it has {count}. This suggests a \
10 bug in the namespace protocol."
11)]
12InvalidNamespaceEntryCount { prefix: String, count: usize },
1314#[error("namespace creation failed: {0:?}")]
15NamespaceCreation(fcomponent::NamespaceError),
1617#[error("the namespace is not installed: {0:?}")]
18NamespaceNotInstalled(#[source] zx::Status),
1920#[error("binding the namespace failed: {0:?}")]
21NamespaceBind(#[source] zx::Status),
2223#[error(
24"namespace {prefix} contains incomplete entry. This suggests a bug in the namespace \
25 protocol {message}"
26)]
27EntryIncomplete { prefix: String, message: String },
2829#[error(
30"namespace {prefix} does not match path. This suggests a bug in the namespace protocol. \
31 Path was {path}"
32)]
33PrefixDoesNotMatchPath { prefix: String, path: String },
3435#[error("failed to connect to protocol: {0}")]
36ConnectionFailed(String),
3738#[error("fidl error")]
39Fidl(#[from] fidl::Error),
4041#[error("operation failed: {0:?}")]
42OperationError(fidl_fuchsia_testing_harness::OperationError),
43}