qubit_execution_services/execution_services_build_error.rs
1/*******************************************************************************
2 *
3 * Copyright (c) 2025 - 2026 Haixing Hu.
4 *
5 * SPDX-License-Identifier: Apache-2.0
6 *
7 * Licensed under the Apache License, Version 2.0.
8 *
9 ******************************************************************************/
10//! Build error for the execution-services facade.
11
12use thiserror::Error;
13
14use super::{
15 ExecutorServiceBuilderError,
16 RayonExecutorServiceBuildError,
17};
18
19/// Error returned when [`super::ExecutionServicesBuilder`] cannot build the facade.
20#[derive(Debug, Error)]
21pub enum ExecutionServicesBuildError {
22 /// The blocking executor-service configuration is invalid.
23 #[error("failed to build blocking executor service: {source}")]
24 Blocking {
25 /// Error returned by the underlying blocking executor builder.
26 #[from]
27 source: ExecutorServiceBuilderError,
28 },
29
30 /// The CPU executor-service configuration is invalid.
31 #[error("failed to build cpu executor service: {source}")]
32 Cpu {
33 /// Error returned by the underlying Rayon executor builder.
34 #[from]
35 source: RayonExecutorServiceBuildError,
36 },
37}